mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-23 10:44: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) {
|
if (message.trim().length === 0 && !args.command) {
|
||||||
UI.error("You must provide a message or a command")
|
UI.error("You must provide a message or a command")
|
||||||
return
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
await bootstrap(process.cwd(), async () => {
|
await bootstrap(process.cwd(), async () => {
|
||||||
@@ -79,7 +79,7 @@ export const RunCommand = cmd({
|
|||||||
const exists = await Command.get(args.command)
|
const exists = await Command.get(args.command)
|
||||||
if (!exists) {
|
if (!exists) {
|
||||||
UI.error(`Command "${args.command}" not found`)
|
UI.error(`Command "${args.command}" not found`)
|
||||||
return
|
process.exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const session = await (async () => {
|
const session = await (async () => {
|
||||||
@@ -104,7 +104,7 @@ export const RunCommand = cmd({
|
|||||||
|
|
||||||
if (!session) {
|
if (!session) {
|
||||||
UI.error("Session not found")
|
UI.error("Session not found")
|
||||||
return
|
process.exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
const cfg = await Config.get()
|
const cfg = await Config.get()
|
||||||
@@ -221,6 +221,7 @@ export const RunCommand = cmd({
|
|||||||
if (errorMsg) process.stdout.write(errorMsg)
|
if (errorMsg) process.stdout.write(errorMsg)
|
||||||
}
|
}
|
||||||
UI.empty()
|
UI.empty()
|
||||||
|
if (errorMsg) process.exit(1)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user