kopia lustrzana https://github.com/c9/core
allow using node-pty-prebuilt
rodzic
79a69bd9f7
commit
e9490da4e7
|
@ -85,15 +85,17 @@ module.exports = function setup(fsOptions) {
|
|||
require("module")._initPaths();
|
||||
}
|
||||
if (!fsOptions.nopty) {
|
||||
var modulesPath = fsOptions.nodePath || process.env.HOME + "/.c9/node_modules";
|
||||
// on darwin trying to load binary for a wrong version crashes the process
|
||||
[(fsOptions.nodePath || process.env.HOME + "/.c9/node_modules") + "/pty.js",
|
||||
"pty.js"].some(function(p) {
|
||||
[modulesPath + "/node-pty-prebuilt",
|
||||
modulesPath + "/pty.js",
|
||||
"node-pty-prebuilt",
|
||||
"pty.js"
|
||||
].some(function(p) {
|
||||
try {
|
||||
pty = require(p);
|
||||
return true;
|
||||
} catch(e) {
|
||||
console.warn(e, p);
|
||||
}
|
||||
} catch(e) {}
|
||||
});
|
||||
if (!pty)
|
||||
console.warn("unable to initialize pty.js:");
|
||||
|
@ -1685,6 +1687,9 @@ module.exports = function setup(fsOptions) {
|
|||
var proc;
|
||||
try {
|
||||
proc = pty.spawn(path, args, options);
|
||||
proc.readable = true;
|
||||
proc.writable = true;
|
||||
|
||||
proc.on("error", function(){
|
||||
// Prevent PTY from throwing an error;
|
||||
// I don't know how to test and the src is funky because
|
||||
|
|
Ładowanie…
Reference in New Issue