From 5ab490a477c5974e9bdcaf233b3358e2e24a6782 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Wed, 7 Mar 2018 10:05:11 +0000 Subject: [PATCH] fix: prevent throw when args missing Fixes #1286 --- lib/config/load.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/config/load.js b/lib/config/load.js index 3c0f36a5..a6dccd87 100644 --- a/lib/config/load.js +++ b/lib/config/load.js @@ -69,6 +69,9 @@ function load(settings, options, config, callback) { if (!options.script && !options.exec) { var found = findAppScript(); if (found) { + if (!options.args) { + options.args = []; + } // if the script is found as a result of not being on the command // line, then we move any of the pre double-dash args in execArgs const n = options.scriptPosition || options.args.length;