Skip to content

Commit 59dc0fc

Browse files
committed
Wire spinner through
1 parent b509f8a commit 59dc0fc

4 files changed

Lines changed: 11 additions & 8 deletions

File tree

src/commands/fix/coana-fix.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export async function coanaFix(
4949

5050
const sockSdk = sockSdkCResult.data
5151

52-
const supportedFilesCResult = await fetchSupportedScanFileNames()
52+
const supportedFilesCResult = await fetchSupportedScanFileNames({ spinner })
5353
if (!supportedFilesCResult.ok) {
5454
return supportedFilesCResult
5555
}

src/commands/scan/fetch-supported-scan-file-names.mts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ import { setupSdk } from '../../utils/sdk.mts'
33

44
import type { CResult } from '../../types.mts'
55
import type { SetupSdkOptions } from '../../utils/sdk.mts'
6+
import type { Spinner } from '@socketsecurity/registry/lib/spinner'
67
import type { SocketSdkSuccessResult } from '@socketsecurity/sdk'
78

89
export type FetchSupportedScanFileNamesOptions = {
910
sdkOpts?: SetupSdkOptions | undefined
11+
spinner?: Spinner | undefined
1012
}
1113

1214
export async function fetchSupportedScanFileNames(
1315
options?: FetchSupportedScanFileNamesOptions | undefined,
1416
): Promise<CResult<SocketSdkSuccessResult<'getReportSupportedFiles'>['data']>> {
15-
const { sdkOpts } = {
17+
const { sdkOpts, spinner } = {
1618
__proto__: null,
1719
...options,
1820
} as FetchSupportedScanFileNamesOptions
@@ -25,5 +27,6 @@ export async function fetchSupportedScanFileNames(
2527

2628
return await handleApiCall(sockSdk.getSupportedScanFiles(), {
2729
desc: 'supported scan file types',
30+
spinner,
2831
})
2932
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ export async function handleCreateNewScan({
7979
logger.info('Auto-generation finished. Proceeding with Scan creation.')
8080
}
8181

82-
const supportedFilesCResult = await fetchSupportedScanFileNames()
82+
const { spinner } = constants
83+
84+
const supportedFilesCResult = await fetchSupportedScanFileNames({ spinner })
8385
if (!supportedFilesCResult.ok) {
8486
await outputCreateNewScan(supportedFilesCResult, {
8587
interactive,
@@ -88,8 +90,6 @@ export async function handleCreateNewScan({
8890
return
8991
}
9092

91-
const { spinner } = constants
92-
9393
spinner.start('Searching for local files to include in scan...')
9494

9595
const supportedFiles = supportedFilesCResult.data

src/commands/scan/handle-scan-reach.mts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ export async function handleScanReach({
2828
reachabilityOptions,
2929
targets,
3030
}: HandleScanReachConfig) {
31+
const { spinner } = constants
32+
3133
// Get supported file names
32-
const supportedFilesCResult = await fetchSupportedScanFileNames()
34+
const supportedFilesCResult = await fetchSupportedScanFileNames({ spinner })
3335
if (!supportedFilesCResult.ok) {
3436
await outputScanReach(supportedFilesCResult, { cwd, outputKind })
3537
return
3638
}
3739

38-
const { spinner } = constants
39-
4040
spinner.start(
4141
'Searching for local manifest files to include in reachability analysis...',
4242
)

0 commit comments

Comments
 (0)