Skip to content

Commit 3f0d7ba

Browse files
Status code clean up
1 parent 21d58dc commit 3f0d7ba

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/commands/run.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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)

src/shell-client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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())

0 commit comments

Comments
 (0)