kopia lustrzana https://github.com/c9/core
Cleanup old ENOENT approach
rodzic
4d49d34712
commit
c1ea5744a0
|
@ -26,7 +26,6 @@ function Parent(fsOptions) {
|
|||
function connect(callback) {
|
||||
var _self = this;
|
||||
try {
|
||||
// Check if file exists first; spawn's ENOENT may arrive after other errors
|
||||
if (!fs.existsSync(nodeBin[0]))
|
||||
return tryNext(new Error("Couldn't find valid node binary"));
|
||||
child = spawn(nodeBin[0], args, options).on("error", tryNext);
|
||||
|
@ -54,14 +53,9 @@ function Parent(fsOptions) {
|
|||
child.removeListener("error", done);
|
||||
child.on("error", function ignore(err) {});
|
||||
child = null;
|
||||
|
||||
if (err && err.code == "ENOENT") {
|
||||
tryNext(err);
|
||||
} else {
|
||||
callback(err, vfs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Override Consumer's disconnect to kill the child process afterwards
|
||||
this.disconnect = disconnect.bind(this);
|
||||
|
|
Ładowanie…
Reference in New Issue