Skip to content

Commit

Permalink
refactor: fix scoping issue in node@4
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed Dec 29, 2017
1 parent 5a914cb commit de66c6b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/config/exec.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,11 @@ function exec(nodemonOptions, execMap) {
}

var options = utils.clone(nodemonOptions || {});
var script;

// if there's no script passed, try to get it from the first argument
if (!options.script && (options.args || []).length) {
const script = expandScript(options.args[0],
script = expandScript(options.args[0],
options.ext && ('.' + (options.ext || 'js').split(',')[0]));

// if the script was found, shift it off our args
Expand Down Expand Up @@ -108,7 +109,7 @@ function exec(nodemonOptions, execMap) {
}

// var options = utils.clone(nodemonOptions || {});
var script = path.basename(options.script || '');
script = path.basename(options.script || '');

var scriptExt = path.extname(script).slice(1);

Expand Down

0 comments on commit de66c6b

Please sign in to comment.