can build node.js file from cwd now

This commit is contained in:
Craig Condon
2011-11-26 17:24:25 -06:00
parent b2f621d7d0
commit d0e259be6f
2 changed files with 9 additions and 3 deletions
+8 -3
View File
@@ -1,16 +1,20 @@
#!/usr/bin/env node
var path = require('path');
var argv = require('optimist').
usage('Usage: $0 -i [sources] -o [binary]').
options('i', {
demand: true,
alias: 'input',
desc: 'The entry javascript files'
desc: 'The entry javascript files',
default: process.cwd()
}).
options('o', {
demand: true,
alias: 'output',
desc: 'The output binary'
desc: 'The output binary',
default: process.cwd() + path.basename(process.cwd()) + '.nex'
}).
options('r', {
alias: 'runtime',
@@ -19,7 +23,8 @@ options('r', {
}).argv;
require('../lib').compile({ entries: argv.input.split(' '), output: argv.output, runtime: argv.r }, function(error) {
require('../lib').compile({ entries: argv.i.split(' '), output: argv.o, runtime: argv.r }, function(error) {
if(error) console.log(error.message);
});
+1
View File
@@ -205,6 +205,7 @@ exports.compile = function(ops, callback) {
console.log('Making executable');
var proc = spawn('make', [], { cwd: node.path });
proc.stdout.on('data', function(data) {