exe: handle tar extraction & download failures better
This commit is contained in:
@@ -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
@@ -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,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
|
||||
|
||||
Reference in New Issue
Block a user