mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-23 02:34:21 +01:00
fix: exit code being non zero when using run cmd (#2523)
This commit is contained in:
@@ -71,7 +71,7 @@ export const RunCommand = cmd({
|
||||
|
||||
if (message.trim().length === 0 && !args.command) {
|
||||
UI.error("You must provide a message or a command")
|
||||
return
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
await bootstrap(process.cwd(), async () => {
|
||||
@@ -79,7 +79,7 @@ export const RunCommand = cmd({
|
||||
const exists = await Command.get(args.command)
|
||||
if (!exists) {
|
||||
UI.error(`Command "${args.command}" not found`)
|
||||
return
|
||||
process.exit(1)
|
||||
}
|
||||
}
|
||||
const session = await (async () => {
|
||||
@@ -104,7 +104,7 @@ export const RunCommand = cmd({
|
||||
|
||||
if (!session) {
|
||||
UI.error("Session not found")
|
||||
return
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
const cfg = await Config.get()
|
||||
@@ -221,6 +221,7 @@ export const RunCommand = cmd({
|
||||
if (errorMsg) process.stdout.write(errorMsg)
|
||||
}
|
||||
UI.empty()
|
||||
if (errorMsg) process.exit(1)
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user