Merge pull request #139 from jaredallard/master

merge with master
This commit is contained in:
Jared Allard
2015-09-28 16:36:40 -07:00
+45 -7
View File
@@ -182,18 +182,37 @@ exports.compile = function (options, complete) {
}
},
/**
* monkeypatch child_process.js so nexejs knows when it is a forked process
*/
function monkeyPatchChildProc(next) {
_monkeyPatchChildProcess(nodeCompiler, next);
},
/**
* monkeypatch child_process.js so nexejs knows when it is a forked process
*/
function monkeyPatchChildProc(next) {
_monkeyPatchChildProcess(nodeCompiler, next);
},
/**
* If an old compiled executable exists in the Release directory, delete it.
* This lets us see if the build failed by checking the existence of this file later.
*/
function cleanUpOldExecutable (next) {
fs.unlink(nodeCompiler.releasePath, function (err) {
if (err) {
if (err.code === "ENOENT") {
next();
} else {
throw err;
}
} else {
next();
}
});
},
/**
* compile the node application
*/
function makeExe (next) {
function makeExecutable (next) {
if(isWin) {
_log("vcbuild [make stage]");
} else {
@@ -210,6 +229,25 @@ exports.compile = function (options, complete) {
mkdirp(path.dirname(options.output), function(){ next(); });
},
/**
* Verify that the executable was compiled successfully
*/
function checkThatExecutableExists (next) {
fs.access(nodeCompiler.releasePath, function (err) {
if (err) {
_log("error",
"The release executable has not been generated. " +
"This indicates a failure in the build process. " +
"There is likely additional information above."
);
throw new Error("The release executable was not built ('" + nodeCompiler.releasePath + "')");
} else {
next();
}
});
},
/**
* Copy the compilied binary to the output specified.
*/