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) {
|
function connect(callback) {
|
||||||
var _self = this;
|
var _self = this;
|
||||||
try {
|
try {
|
||||||
// Check if file exists first; spawn's ENOENT may arrive after other errors
|
|
||||||
if (!fs.existsSync(nodeBin[0]))
|
if (!fs.existsSync(nodeBin[0]))
|
||||||
return tryNext(new Error("Couldn't find valid node binary"));
|
return tryNext(new Error("Couldn't find valid node binary"));
|
||||||
child = spawn(nodeBin[0], args, options).on("error", tryNext);
|
child = spawn(nodeBin[0], args, options).on("error", tryNext);
|
||||||
|
@ -54,12 +53,7 @@ function Parent(fsOptions) {
|
||||||
child.removeListener("error", done);
|
child.removeListener("error", done);
|
||||||
child.on("error", function ignore(err) {});
|
child.on("error", function ignore(err) {});
|
||||||
child = null;
|
child = null;
|
||||||
|
callback(err, vfs);
|
||||||
if (err && err.code == "ENOENT") {
|
|
||||||
tryNext(err);
|
|
||||||
} else {
|
|
||||||
callback(err, vfs);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue