File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ export default class Run extends Command {
4545 } )
4646
4747 if ( result . exitCode !== 0 ) {
48- this . exit ( result . exitCode )
48+ process . exitCode = result . exitCode ;
4949 }
5050 } catch ( error ) {
5151 this . error ( ( error as Error ) . message )
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export function runShell(options: ShellOptions): Promise<ShellResult> {
3939 return new Promise ( ( resolve , reject ) => {
4040 const wsUrl = `wss://${ discoConfig . host } /api/projects/${ project } /run`
4141 const ws = new WS ( wsUrl )
42- let exitCode = 0
42+ let exitCode = - 1 ;
4343
4444 ws . on ( 'open' , ( ) => {
4545 const authMessage : { token : string ; service ?: string ; command ?: string } = { token : discoConfig . apiKey }
@@ -94,7 +94,7 @@ export function runShell(options: ShellOptions): Promise<ShellResult> {
9494 } else if ( message . type === 'ping' && ws . readyState === WS . OPEN ) {
9595 ws . send ( JSON . stringify ( { type : 'pong' } ) )
9696 } else if ( message . type === 'exit' ) {
97- exitCode = message . code ?? 0
97+ exitCode = message . code ?? - 1
9898 }
9999 } catch {
100100 process . stdout . write ( data . toString ( ) )
You can’t perform that action at this time.
0 commit comments