File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -114,7 +114,12 @@ async function auth(
114114 }
115115 } ;
116116 if ( options . github ) {
117- const config = getMergedConfig ( ) ;
117+ let config ;
118+ try {
119+ config = getMergedConfig ( ) ;
120+ } catch {
121+ config = { } ;
122+ }
118123 if ( ! Object . hasOwn ( config , 'token' ) || ! Object . hasOwn ( config , 'username' ) ) {
119124 process . stdout . write (
120125 'If this is your first time running this command, ' +
Original file line number Diff line number Diff line change @@ -16,6 +16,11 @@ async function mockCredentials(options) {
1616( async function ( ) {
1717 const { default : auth } = await import ( '../../lib/auth.js' ) ;
1818 const authParams = await auth ( { github : true } , mockCredentials ) ;
19+ if ( typeof authParams === 'object' && authParams != null ) {
20+ for ( const key of Object . getOwnPropertyNames ( authParams ) ) {
21+ if ( key !== 'github' ) delete authParams [ key ] ;
22+ }
23+ }
1924 process . stdout . write ( `${ JSON . stringify ( authParams ) } \n` ) ;
2025} ) ( ) . catch ( err => {
2126 console . error ( err ) ;
You can’t perform that action at this time.
0 commit comments