From 855787c94bd6acefbfa582e7d46aa8d7b92669af Mon Sep 17 00:00:00 2001 From: Peter van der Zee Date: Mon, 7 Apr 2025 13:41:44 +0200 Subject: [PATCH] When scan create has no files, do not proceed to upload --- src/commands/scan/handle-create-new-scan.ts | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/commands/scan/handle-create-new-scan.ts b/src/commands/scan/handle-create-new-scan.ts index a4bcaff5b..f30c2c750 100644 --- a/src/commands/scan/handle-create-new-scan.ts +++ b/src/commands/scan/handle-create-new-scan.ts @@ -45,13 +45,18 @@ export async function handleCreateNewScan({ supportedFileNames ) - handleBadInput({ - nook: true, - test: packagePaths.length > 0, - pass: 'ok', - fail: 'found none', - message: 'TARGET must contain matching / supported file types for a scan' - }) + if ( + handleBadInput({ + nook: true, + test: packagePaths.length > 0, + pass: 'ok', + fail: 'found no eligible files to scan', + message: + 'TARGET (file/dir) must contain matching / supported file types for a scan' + }) + ) { + return + } if (readOnly) { logger.log('[ReadOnly] Bailing now')