Skip to content

Commit a9fccf4

Browse files
authored
Merge branch 'main' into scan_suggestion_flow
2 parents a4fb24a + 4612767 commit a9fccf4

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
"test:prepare": "cross-env VITEST=1 npm run build",
6262
"test:unit": "vitest --run",
6363
"test:unit:coverage": "vitest run --coverage",
64-
"test:unit:update-snapshots": "vitest --update",
6564
"test-ci": "run-s test:*",
65+
"testu": "npm run build:dist; VITEST=1 npm run build:test-dist ; npm run test:unit -- -u",
6666
"update": "run-p --aggregate-output update:**",
6767
"update:deps": "npx --yes npm-check-updates"
6868
},

src/commands/repos/list-repos.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ export async function listRepos({
4848
return
4949
}
5050

51+
spinner.stop()
52+
53+
if (outputJson) {
54+
const data = result.data.results.map(o => ({
55+
id: o.id,
56+
name: o.name,
57+
visibility: o.visibility,
58+
defaultBranch: o.default_branch,
59+
archived: o.archived
60+
}))
61+
console.log(JSON.stringify(data, null, 2))
62+
return
63+
}
64+
5165
const options = {
5266
columns: [
5367
{ field: 'id', name: colors.magenta('ID') },
@@ -58,5 +72,5 @@ export async function listRepos({
5872
]
5973
}
6074

61-
spinner.stop(chalkTable(options, result.data.results))
75+
console.log(chalkTable(options, result.data.results))
6276
}

src/utils/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export function handleUnsuccessfulApiResponse<T extends SocketSdkOperations>(
2828
spinner.stop()
2929
throw new AuthError(message)
3030
}
31-
spinner.error(
31+
spinner.errorAndStop(
3232
`${colors.bgRed(colors.white('API returned an error:'))} ${message}`
3333
)
3434
process.exit(1)

0 commit comments

Comments
 (0)