From 89d6062c687dce31f7878f3b7f427ed332e5cdd9 Mon Sep 17 00:00:00 2001 From: Remy Sharp Date: Tue, 13 Mar 2018 21:46:20 +0000 Subject: [PATCH] fix: prevent throw when args missing (#1288) 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;