Permalink
Browse files

Adding which npm module to execute sub builds with shifter

  • Loading branch information...
1 parent 0e8c33c commit 8b2404ba54de3ea55ba38af0f34222423368e19d @davglass committed Sep 5, 2012
Showing with 8 additions and 4 deletions.
  1. +2 −1 lib/builder.js
  2. +2 −1 lib/walk.js
  3. +2 −1 lib/watch.js
  4. +2 −1 package.json
View
@@ -8,6 +8,7 @@ var path = require('path'),
log = require('./log'),
noop = function () {},
timer = require('./timer'),
+ which = require('which').sync,
spawn = require('child_process').spawn,
Stack = require('./stack').Stack,
module = require('./module');
@@ -39,7 +40,7 @@ var prebuild = function (jobs, options, callback) {
if (options.coverage === false) {
args.push('--no-coverage');
}
- child = spawn('shifter', args, {
+ child = spawn(which('shifter'), args, {
cwd: path.join(process.cwd(), '../', job)
});
View
@@ -6,6 +6,7 @@ var log = require('./log'),
path = require('path'),
spawn = require('child_process').spawn,
exists = fs.exists || path.exists,
+ which = require('which').sync,
has = function (opt, name) {
return opt.some(function (v) {
return (v === name);
@@ -65,7 +66,7 @@ exports.run = function (options) {
run = function () {
var mod = mods.pop(), child;
if (mod) {
- child = spawn('shifter', args, {
+ child = spawn(which('shifter'), args, {
cwd: path.join(process.cwd(), mod),
stdio: ['ignore', 'ignore', process.stderr]
});
View
@@ -2,6 +2,7 @@ var log = require('./log'),
watch = require('watch'),
path = require('path'),
fs = require('fs'),
+ which = require('which').sync,
timer = require('./timer'),
dirs = [
'assets',
@@ -25,7 +26,7 @@ var build = function (cwd) {
log.warn('change detected while a build is in progress, you\'re too fast for me');
return false;
}
- var child = spawn('shifter', buildArgs, {
+ var child = spawn(which('shifter'), buildArgs, {
cwd: cwd
}), start = new Date();
View
@@ -16,7 +16,8 @@
"watch": "*",
"ncp": "*",
"mkdirp": "*",
- "rimraf": "*"
+ "rimraf": "*",
+ "which": "*"
},
"devDependencies": {
"selleck": "*",

0 comments on commit 8b2404b

Please sign in to comment.