Skip to content

Commit d2aa839

Browse files
pvdzjdalton
andauthored
Fix output; some was breaking --json, some typos (#502)
* Fix output; some was breaking --json, some typos * shure --------- Co-authored-by: John-David Dalton <jdalton@users.noreply.github.com>
1 parent 37284d2 commit d2aa839

10 files changed

+12
-12
lines changed

src/commands/package/fetch-purl-deep-score.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export interface PurlDataResponse {
5858
export async function fetchPurlDeepScore(
5959
purl: string
6060
): Promise<CResult<PurlDataResponse>> {
61-
logger.info(`Requesting deep score data for this purl: ${purl}`)
61+
logger.error(`Requesting deep score data for this purl: ${purl}`)
6262

6363
const apiToken = getDefaultToken()
6464
if (!apiToken) {
@@ -96,7 +96,7 @@ export async function fetchPurlDeepScore(
9696
return {
9797
ok: false,
9898
message: 'Socket API returned an error',
99-
cause: `${result.statusText}${err ? ` (cause: ${err}` : ''}`
99+
cause: `${result.statusText}${err ? ` (cause: ${err})` : ''}`
100100
}
101101
}
102102

src/commands/package/fetch-purls-shallow-score.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import type {
1313
export async function fetchPurlsShallowScore(
1414
purls: string[]
1515
): Promise<CResult<SocketSdkReturnType<'batchPackageFetch'>>> {
16-
logger.info(
16+
logger.error(
1717
`Requesting shallow score data for ${purls.length} package urls (purl): ${purls.join(', ')}`
1818
)
1919

src/commands/scan/cmd-scan-report.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ async function run(
142142
},
143143
{
144144
test: !!scanId,
145-
message: 'Scan ID to fetch',
145+
message: 'Scan ID to report on',
146146
pass: 'ok',
147147
fail: 'missing'
148148
},

src/commands/scan/cmd-scan-report.test.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ describe('socket scan report', async () => {
8484
8585
- Org name must be the first argument (\\x1b[31mmissing\\x1b[39m)
8686
87-
- Scan ID to fetch (\\x1b[31mmissing\\x1b[39m)
87+
- Scan ID to report on (\\x1b[31mmissing\\x1b[39m)
8888
8989
- You need to be logged in to use this command. See \`socket login\`. (\\x1b[31mmissing API token\\x1b[39m)
9090
\\x1b[22m"

src/commands/scan/cmd-scan-view.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ async function run(
119119
},
120120
{
121121
test: !!scanId,
122-
message: 'Scan ID to delete',
122+
message: 'Scan ID to view',
123123
pass: 'ok',
124124
fail: 'missing'
125125
},

src/commands/scan/cmd-scan-view.test.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ describe('socket scan view', async () => {
7373
7474
- Org name must be the first argument (\\x1b[31mmissing\\x1b[39m)
7575
76-
- Scan ID to delete (\\x1b[31mmissing\\x1b[39m)
76+
- Scan ID to view (\\x1b[31mmissing\\x1b[39m)
7777
7878
- You need to be logged in to use this command. See \`socket login\`. (\\x1b[31mmissing API token\\x1b[39m)
7979
\\x1b[22m"

src/commands/scan/fetch-diff-scan.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export async function fetchDiffScan({
3838
return {
3939
ok: false,
4040
message: 'Socket API returned an error',
41-
cause: `${response.statusText}${err ? ` (cause: ${err}` : ''}`
41+
cause: `${response.statusText}${err ? ` (cause: ${err})` : ''}`
4242
}
4343
}
4444

src/commands/scan/fetch-report-data.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export async function fetchReportData(
6060
function updateProgress() {
6161
if (finishedFetching) {
6262
spinner.stop()
63-
logger.info(
63+
logger.error(
6464
`Scan result: ${scanStatus}. Security policy: ${policyStatus}.`
6565
)
6666
} else {
@@ -85,7 +85,7 @@ export async function fetchReportData(
8585
return {
8686
ok: false,
8787
message: 'Socket API returned an error',
88-
cause: `${response.statusText}${err ? ` (cause: ${err}` : ''}`
88+
cause: `${response.statusText}${err ? ` (cause: ${err})` : ''}`
8989
}
9090
}
9191

src/commands/scan/fetch-scan.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export async function fetchScan(
3636
return {
3737
ok: false,
3838
message: 'Socket API returned an error',
39-
cause: `${response.statusText}${err ? ` (cause: ${err}` : ''}`
39+
cause: `${response.statusText}${err ? ` (cause: ${err})` : ''}`
4040
}
4141
}
4242

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export async function fetchSupportedScanFileNames(): Promise<
2323
)
2424

2525
spinner.stop()
26-
logger.success('Received response while fetched supported scan file types.')
26+
logger.error('Received response while fetching supported scan file types.')
2727

2828
if (!result.success) {
2929
return handleFailedApiResponse('getReportSupportedFiles', result)

0 commit comments

Comments
 (0)