Skip to content

Commit 855787c

Browse files
committed
When scan create has no files, do not proceed to upload
1 parent e376d50 commit 855787c

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/commands/scan/handle-create-new-scan.ts

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,18 @@ export async function handleCreateNewScan({
4545
supportedFileNames
4646
)
4747

48-
handleBadInput({
49-
nook: true,
50-
test: packagePaths.length > 0,
51-
pass: 'ok',
52-
fail: 'found none',
53-
message: 'TARGET must contain matching / supported file types for a scan'
54-
})
48+
if (
49+
handleBadInput({
50+
nook: true,
51+
test: packagePaths.length > 0,
52+
pass: 'ok',
53+
fail: 'found no eligible files to scan',
54+
message:
55+
'TARGET (file/dir) must contain matching / supported file types for a scan'
56+
})
57+
) {
58+
return
59+
}
5560

5661
if (readOnly) {
5762
logger.log('[ReadOnly] Bailing now')

0 commit comments

Comments
 (0)