From 298690d1bed85ecb0cb156d158fe19bb9a439803 Mon Sep 17 00:00:00 2001 From: Sunil Pai Date: Thu, 18 Jul 2019 19:21:17 +0100 Subject: [PATCH] Fix Unhandled Promise rejection when called with a non-existent path When jscodeshift is called with a path that doesn't exist, `concatAll()` gets called with `undefined`, which isn't an interable, and throws an error. This PR fixes the promise being resolved by matching it with the ignore case. --- src/Runner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Runner.js b/src/Runner.js index 311caec0..45d64952 100644 --- a/src/Runner.js +++ b/src/Runner.js @@ -141,7 +141,7 @@ function getAllFiles(paths, filter) { fs.lstat(file, (err, stat) => { if (err) { process.stderr.write('Skipping path ' + file + ' which does not exist. \n'); - resolve(); + resolve([]); return; }