Skip to content

Commit fde03d3

Browse files
authored
fix: exit code being non zero when using run cmd (anomalyco#2523)
1 parent 9045f13 commit fde03d3

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • packages/opencode/src/cli/cmd

packages/opencode/src/cli/cmd/run.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ export const RunCommand = cmd({
7171

7272
if (message.trim().length === 0 && !args.command) {
7373
UI.error("You must provide a message or a command")
74-
return
74+
process.exit(1)
7575
}
7676

7777
await bootstrap(process.cwd(), async () => {
7878
if (args.command) {
7979
const exists = await Command.get(args.command)
8080
if (!exists) {
8181
UI.error(`Command "${args.command}" not found`)
82-
return
82+
process.exit(1)
8383
}
8484
}
8585
const session = await (async () => {
@@ -104,7 +104,7 @@ export const RunCommand = cmd({
104104

105105
if (!session) {
106106
UI.error("Session not found")
107-
return
107+
process.exit(1)
108108
}
109109

110110
const cfg = await Config.get()
@@ -221,6 +221,7 @@ export const RunCommand = cmd({
221221
if (errorMsg) process.stdout.write(errorMsg)
222222
}
223223
UI.empty()
224+
if (errorMsg) process.exit(1)
224225
})
225226
},
226227
})

0 commit comments

Comments
 (0)