From 5ceb4e9fdbb9eefaef07f3b528cbb809e46f7eea Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Fri, 18 Sep 2020 22:04:31 +0200 Subject: [PATCH] Minor tweaks Fixes #18 --- cli.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cli.js b/cli.js index 4ce295d..bb29ddb 100755 --- a/cli.js +++ b/cli.js @@ -27,16 +27,16 @@ const cli = meow(` } }); -if (cli.input.length === 0) { - console.error('Specify at least one path'); - process.exit(1); -} - (async () => { + if (cli.input.length === 0) { + console.error('Specify at least one path'); + process.exitCode = 1; + return; + } + const files = await del(cli.input, cli.flags); if (cli.flags.dryRun) { console.log(files.join('\n')); } })(); -