fix: exit code being non zero when using run cmd (#2523)

This commit is contained in:
Aiden Cline
2025-09-09 12:00:55 -05:00
committed by GitHub
parent 9045f13acc
commit fde03d3c93

View File

@@ -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)
}) })
}, },
}) })