Skip to content

Commit

Permalink
[fix] Dont slice off arguments after [SCRIPT] if it is not passed to …
Browse files Browse the repository at this point in the history
…the CLI (e.g. forever list)
  • Loading branch information
indexzero committed Feb 15, 2011
1 parent 7c0c3b8 commit 9d2eefa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/forever
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if (accepts.indexOf(process.argv[2]) !== -1) {
}

var argv = require('optimist').argv;

require.paths.unshift(path.join(__dirname, '..', 'lib'));

var forever = require('forever');
Expand Down Expand Up @@ -81,11 +80,12 @@ if (argv.h || argv.help ||
// If we are passed more than one non-hyphenated
// options, only use the first one. Assume the
// rest are pass-through for the child process
var file = argv._[0];
var file = argv._[0], options = {};

// Setup pass-thru options for child-process
var options = {};
options.options = process.argv.splice(process.argv.indexOf(file)).splice(1);
if (file) {
options.options = process.argv.splice(process.argv.indexOf(file)).splice(1);
}

// Now that we've removed the target script options
// reparse the options and configure the forever settings
Expand Down

0 comments on commit 9d2eefa

Please sign in to comment.