exe: handle tar extraction & download failures better

This commit is contained in:
Jared Allard
2016-01-24 21:08:38 -08:00
parent 336a5ea2e3
commit 635cd62196
3 changed files with 13 additions and 2 deletions
-2
View File
@@ -44,8 +44,6 @@ function bundle (input, nc, complete) {
var ws = fs.createWriteStream(bundlePath);
var proc = spawn('node', [path.join(__dirname, '../', 'node_modules/browserify/bin/cmd.js'), '--node', input ]);
// TODO: Get path of nexe directory, and refer to it.
proc.stdout.pipe(ws);
proc.on('error', function(err) {
+12
View File
@@ -359,6 +359,11 @@ function _downloadNode(version, directory, nodeConfigureArgs, nodeMakeArgs, comp
tar.stderr.pipe(process.stderr);
tar.on("close", function () { next(); })
tar.on("error", function (err) {
console.log(err);
_log("error", "failed to extract the node tar file.");
process.exit(1);
});
}
},
@@ -701,6 +706,12 @@ function _logProgress (req) {
});
});
req.on("error", function(err) {
console.log(err);
_log("error", "failed to download node sources,");
process.exit(1);
});
return req;
}
@@ -711,6 +722,7 @@ function _logProgress (req) {
* @param {object} options - fallback options
*
* @todo implement options overriding package defaults.
* @todo make this much less hackily implemented....
*
* @return {object} nexe.compile options object
**/
+1
View File
@@ -1,5 +1,6 @@
/**
* Copyright (c) 2013 Craig Condon
* Copyright (c) 2015-2016 Jared Allard
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the