11import path from 'node:path'
22
3+ import { joinAnd } from '@socketsecurity/registry/lib/arrays'
34import { logger } from '@socketsecurity/registry/lib/logger'
45
56import { handleCreateNewScan } from './handle-create-new-scan.mts'
@@ -256,7 +257,7 @@ async function run(
256257 for ( const ecosystem of reachEcosystemsRaw ) {
257258 if ( ! validEcosystems . includes ( ecosystem ) ) {
258259 throw new Error (
259- `Invalid ecosystem: "${ ecosystem } ". Valid values are: ${ validEcosystems . join ( ', ' ) } ` ,
260+ `Invalid ecosystem: "${ ecosystem } ". Valid values are: ${ joinAnd ( validEcosystems ) } ` ,
260261 )
261262 }
262263 reachEcosystems . push ( ecosystem as PURL_Type )
@@ -418,7 +419,7 @@ async function run(
418419 nook : true ,
419420 test : hasApiToken ,
420421 message : 'This command requires an API token for access' ,
421- fail : 'missing ( try `socket login`) ' ,
422+ fail : 'try `socket login`' ,
422423 } ,
423424 {
424425 nook : true ,
@@ -439,7 +440,6 @@ async function run(
439440 reachDisableAnalytics ===
440441 reachabilityFlags [ 'reachDisableAnalytics' ] ?. default ,
441442 message : 'The --reachDisableAnalytics flag requires --reach to be set' ,
442- pass : 'ok' ,
443443 fail : 'missing --reach flag' ,
444444 } ,
445445 {
@@ -449,7 +449,6 @@ async function run(
449449 reachAnalysisMemoryLimit ===
450450 reachabilityFlags [ 'reachAnalysisMemoryLimit' ] ?. default ,
451451 message : 'The --reachAnalysisMemoryLimit flag requires --reach to be set' ,
452- pass : 'ok' ,
453452 fail : 'missing --reach flag' ,
454453 } ,
455454 {
@@ -459,29 +458,25 @@ async function run(
459458 reachAnalysisTimeout ===
460459 reachabilityFlags [ 'reachAnalysisTimeout' ] ?. default ,
461460 message : 'The --reachAnalysisTimeout flag requires --reach to be set' ,
462- pass : 'ok' ,
463461 fail : 'missing --reach flag' ,
464462 } ,
465463 {
466464 nook : true ,
467465 test : reach || ! reachEcosystems . length ,
468466 message : 'The --reachEcosystems flag requires --reach to be set' ,
469- pass : 'ok' ,
470467 fail : 'missing --reach flag' ,
471468 } ,
472469 {
473470 nook : true ,
474471 test : reach || ! reachContinueOnFailingProjects ,
475472 message :
476473 'The --reachContinueOnFailingProjects flag requires --reach to be set' ,
477- pass : 'ok' ,
478474 fail : 'missing --reach flag' ,
479475 } ,
480476 {
481477 nook : true ,
482478 test : reach || ! reachExcludePaths . length ,
483479 message : 'The --reachExcludePaths flag requires --reach to be set' ,
484- pass : 'ok' ,
485480 fail : 'missing --reach flag' ,
486481 } ,
487482 )
0 commit comments