File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -151,9 +151,10 @@ export class Login {
151
151
const url = `${ this . loginHost } ${ urls . browser_url } `
152
152
const cp = await opn ( url , { wait : false } )
153
153
cp . on ( 'error' , ux . error )
154
+ const showUrl = ( ) => ux . warn ( `Cannot open browser. Go to ${ color . greenBright ( url ) } to finish login or run ${ color . cmd ( 'heroku login --interactive' ) } \n` )
155
+ if ( process . env . HEROKU_TESTING_HEADLESS_LOGIN === '1' ) showUrl ( )
154
156
cp . on ( 'close' , code => {
155
- if ( code === 0 ) return
156
- process . stderr . write ( `Cannot open browser. Go to ${ color . greenBright ( url ) } to finish login or run ${ color . cmd ( 'heroku login --interactive' ) } \n` )
157
+ if ( code !== 0 ) showUrl ( )
157
158
} )
158
159
ux . action . start ( 'Waiting for login' )
159
160
const { body : auth } = await HTTP . get ( `${ this . loginHost } ${ urls . cli_url } ` , {
You can’t perform that action at this time.
0 commit comments