From 52890fa4b06c7997970e904807562b1407a24f2c Mon Sep 17 00:00:00 2001 From: Aleksei Androsov Date: Wed, 9 Jan 2019 13:13:16 +0300 Subject: [PATCH] Fix {cwd:undefined} options to prevent crash in path.join This bug fixes problem with latest dir-glob@2.2.0 --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 2a79fa8..7c5327f 100644 --- a/index.js +++ b/index.js @@ -47,7 +47,10 @@ const generateGlobTasks = (patterns, taskOptions) => { }; const globDirs = (task, fn) => { - let options = {cwd: task.options.cwd}; + let options = {}; + if (task.options.cwd) { + options.cwd = task.options.cwd; + } if (Array.isArray(task.options.expandDirectories)) { options = Object.assign(options, {files: task.options.expandDirectories});