From acd18fd4c4901573d02a9555a6c2a0200ae2016a Mon Sep 17 00:00:00 2001 From: Janey2022 <108857311+Janey2022@users.noreply.github.com> Date: Fri, 4 Oct 2024 18:56:31 +0800 Subject: [PATCH] Remove exit(1) when no files found to scan (#64) * fix the process exit when hanlding the loop cases * use throw exception instead --- src/run.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/run.js b/src/run.js index 11133fb..7f2a0ed 100644 --- a/src/run.js +++ b/src/run.js @@ -31,7 +31,7 @@ async function run({ if (files.length === 0) { console.error(`No files found to scan.`); - process.exit(1); + throw new Error(`No files found to scan.`); } let report = {};