File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments