diff --git a/bin/nexe b/bin/nexe index a36dfc9..ab76723 100755 --- a/bin/nexe +++ b/bin/nexe @@ -20,6 +20,11 @@ options('r', { alias: 'runtime', default: '0.8.21', description: 'The node.js runtime to use' +}). +options('t', { + alias: 'temp', + default: '/tmp/nexe', + description: 'The path to store node.js sources' }); var argv = cli.argv; @@ -38,7 +43,7 @@ function toRelative(pt) { -require('../lib').compile({ input: toRelative(argv.i), output: toRelative(argv.o), runtime: argv.r }, function(error) { - +require('../lib').compile({ input: toRelative(argv.i), output: toRelative(argv.o), runtime: argv.r, temp: toRelative(argv.t) }, function(error) { + if(error) console.log(error.message); -}); \ No newline at end of file +}); diff --git a/lib/index.js b/lib/index.js index 7f3a6a0..cfd9e50 100644 --- a/lib/index.js +++ b/lib/index.js @@ -27,7 +27,7 @@ exports.compile = function(args, next) { */ function() { - downloadNode(args.runtime, this); + downloadNode(args.runtime, args.temp, this); }, /** @@ -93,9 +93,9 @@ exports.compile = function(args, next) { /** */ -function downloadNode(version, next) { +function downloadNode(version, temp, next) { - var tmpPath = path.join("/tmp/nexe", "node-v" + version + ".tar.gz"), + var tmpPath = path.join(temp, "node-v" + version + ".tar.gz"), srcDr = tmpPath.replace(/\.tar.gz$/, ""); try {