Skip to content

Commit

Permalink
move args.unshift(util.shifter) out of walk.js's run() loop
Browse files Browse the repository at this point in the history
The path 'shifter/bin/shifter' was prepended to the spawn argument list
on each iteration of run(), which can be called many times in walk.js.
This grew the argument list. The extra args are ultimately ignored, but
this small fix prevents non-parsed arg pollution (i.e. the values nopt
returns in the parsed.remain property).
  • Loading branch information
Isao Yagi committed Aug 28, 2013
1 parent 298e5f8 commit 75a5e4e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/walk.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ exports.run = function (options, callback) {
log.info('using ' + args.join(' ')); log.info('using ' + args.join(' '));
} }


args.unshift(util.shifter);

checkDirectory = function(startdir, workingdir) { checkDirectory = function(startdir, workingdir) {
fs.readdir(workingdir, modStack.add(function (err, dirs) { fs.readdir(workingdir, modStack.add(function (err, dirs) {
dirs.forEach(function (mod) { dirs.forEach(function (mod) {
Expand Down Expand Up @@ -144,7 +146,6 @@ exports.run = function (options, callback) {
run = function () { run = function () {
var mod = mods.pop(), child; var mod = mods.pop(), child;
if (mod) { if (mod) {
args.unshift(util.shifter);
child = spawn(process.execPath, args, { child = spawn(process.execPath, args, {
cwd: path.join(shifter.cwd(), mod), cwd: path.join(shifter.cwd(), mod),
stdio: [process.stdin, 'ignore', process.stderr] stdio: [process.stdin, 'ignore', process.stderr]
Expand Down

0 comments on commit 75a5e4e

Please sign in to comment.