Skip to content

Commit 840b39e

Browse files
authored
Merge branch 'main' into testu
2 parents 46d2dd2 + c583689 commit 840b39e

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

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)