Comparing version 0.2.1 to 0.2.2
@@ -0,1 +1,5 @@ | ||
### 0.2.2 | ||
* Text and coverage tests *.js files in test/ dir and subdirs by default | ||
* Stream child process output | ||
### 0.2.1 | ||
@@ -2,0 +6,0 @@ * Add mode support (BOB_MODE=robot FTW!) |
@@ -1,2 +0,3 @@ | ||
var child_process = require('child_process'); | ||
var child_process = require('child_process'), | ||
path = require('path'); | ||
@@ -6,15 +7,17 @@ function Bob(toolbelt, conf) { | ||
function build(bobDir, params, targets) { | ||
var command = 'make -f ' + bobDir + '/conf/Makefile ' | ||
+ toolbelt.args(conf, params) | ||
+ ' ' + targets.join(' '), | ||
exec; | ||
//console.log("Command:" + command); | ||
exec = child_process.exec(command, | ||
function (error, stdout, stderr) { | ||
if (error) { | ||
console.error(error.message); | ||
} else { | ||
console.log(stdout); | ||
} | ||
}); | ||
var command = 'make', | ||
args = ['-f', path.join(bobDir, 'conf/Makefile')] | ||
.concat(toolbelt.args(conf, params), targets), | ||
spawn = child_process.spawn(command, args); | ||
//console.error('Args: ' + args.join(' ')); | ||
spawn.stdout.on('data', function (data) { | ||
console.log('' + data); | ||
}); | ||
spawn.stderr.on('data', function (data) { | ||
console.error('' + data); | ||
}); | ||
spawn.on('exit', function (code) { | ||
console.log('Exit code ' + code); | ||
process.exit(code); | ||
}); | ||
} | ||
@@ -21,0 +24,0 @@ |
@@ -6,3 +6,3 @@ function Toolbelt() { | ||
temp = conf, | ||
value = undefined; | ||
value; | ||
propNames.forEach(function (propName) { | ||
@@ -20,9 +20,9 @@ if (temp[propName]) { | ||
function args(conf, params) { | ||
var args = []; | ||
var argx = []; | ||
if (params && params.join) { | ||
params.forEach(function (param) { | ||
args.push(param.name + '="' + (val(conf, param.name.toLowerCase().replace(/_/g, '.'), param.defaultVal) || '') + '"'); | ||
argx.push(param.name + '=' + (val(conf, param.name.toLowerCase().replace(/_/g, '.'), param.defaultVal) || '')); | ||
}); | ||
} | ||
return args.join(' '); | ||
return argx; | ||
} | ||
@@ -29,0 +29,0 @@ |
{ | ||
"name": "bob", | ||
"description": "A minimalistic build script for Node.js projects.", | ||
"description": "A minimalistic build tool for Node.js projects.", | ||
"keywords": ["build", "deploy", "make"], | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"homepage" : "http://github.com/cliffano/bob", | ||
@@ -7,0 +7,0 @@ "author": "Cliffano Subagio <blah@cliffano.com> (http://blog.cliffano.com)", |
@@ -23,6 +23,6 @@ var assert = require('assert'), | ||
}, | ||
'val should return empty string when property is undefined and no default value provided': function (topic) { | ||
'val should return undefined when property is undefined and no default value provided': function (topic) { | ||
assert.isUndefined(topic.val(conf, undefined)); | ||
}, | ||
'args should return Makefile argument string when params are provided': function (topic) { | ||
'args should return argument array when params are provided': function (topic) { | ||
var params = [ | ||
@@ -33,14 +33,18 @@ { name: 'A_B_C', defaultVal: 'some default' }, | ||
{ name: 'FOOBAR' } | ||
]; | ||
assert.equal(topic.args(conf, params), | ||
'A_B_C="js-fu" X_Y_Z="woo hoo" D_E_F="asyncism" FOOBAR=""'); | ||
], | ||
args = topic.args(conf, params); | ||
assert.equal(args.length, 4); | ||
assert.equal(args[0], 'A_B_C=js-fu'); | ||
assert.equal(args[1], 'X_Y_Z=woo hoo'); | ||
assert.equal(args[2], 'D_E_F=asyncism'); | ||
assert.equal(args[3], 'FOOBAR='); | ||
}, | ||
'args should return empty string when params is an empty string': function (topic) { | ||
assert.equal(topic.args(conf, []), ''); | ||
'args should return empty array when params is an empty array': function (topic) { | ||
assert.isEmpty(topic.args(conf, [])); | ||
}, | ||
'args should return empty string when params is null': function (topic) { | ||
assert.equal(topic.args(conf, null), ''); | ||
'args should return empty array when params is null': function (topic) { | ||
assert.isEmpty(topic.args(conf, null)); | ||
}, | ||
'args should return empty string when params is undefined': function (topic) { | ||
assert.equal(topic.args(conf, undefined), ''); | ||
'args should return empty array when params is undefined': function (topic) { | ||
assert.isEmpty(topic.args(conf, undefined)); | ||
}, | ||
@@ -62,2 +66,2 @@ 'merge should return an object with properties from multiple objects': function (topic) { | ||
} | ||
}).export(module); | ||
}).exportTo(module); |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15551
185