Skip to content

Commit

Permalink
fallback to an empty array if args is null or undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
shinnn committed Oct 1, 2015
1 parent 2458e86 commit f0dd27a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ module.exports = function execFileSubcommand(command, subcommand, args, options,
' Expected a list of arguments to be passed to' +
' `' + command + ' ' + subcommand + '` command.'
);
} else {
args = [];
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"repository": "shinnn/execfile-subcommand",
"author": "Shinnosuke Watanabe (https://github.com/shinnn)",
"scripts": {
"pretest": "eslint --config @shinnn/node index.js test.js",
"pretest": "eslint --config @shinnn/node --rule 'complexity: [2, 15]' index.js test.js",
"test": "node --harmony_rest_parameters --throw-deprecation --track-heap-objects test.js",
"coverage": "node --harmony_rest_parameters node_modules/.bin/istanbul cover test.js"
},
Expand Down

0 comments on commit f0dd27a

Please sign in to comment.