Add -t|--temp option to specify location for node.js sources
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
+3
-3
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user