mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
refactor: fix exit status code
This commit is contained in:
@@ -180,6 +180,8 @@ export async function handle(args: ArgumentsCamelCase) {
|
||||
if (models.length === 0) {
|
||||
if (!args.quiet && !structured) UI.println(`${color(UI.Style.TEXT_WARNING)}No models to test after filtering.${color(UI.Style.TEXT_NORMAL)}`)
|
||||
if (json) console.log(JSON.stringify([], null, 2))
|
||||
if (args.output === "md") console.log(formatMarkdown([]))
|
||||
if (structured) return
|
||||
process.exitCode = 1
|
||||
return
|
||||
}
|
||||
|
||||
@@ -134,6 +134,7 @@ describe("handle", () => {
|
||||
test("does not print progress before markdown output", async () => {
|
||||
const logs: string[] = []
|
||||
const print = console.log
|
||||
const code = process.exitCode
|
||||
|
||||
console.log = (msg?: unknown) => {
|
||||
logs.push(String(msg))
|
||||
@@ -152,9 +153,9 @@ describe("handle", () => {
|
||||
})
|
||||
} finally {
|
||||
console.log = print
|
||||
process.exitCode = undefined
|
||||
process.exitCode = code
|
||||
}
|
||||
|
||||
expect(logs).toEqual([])
|
||||
expect(logs).toEqual([formatMarkdown([])])
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user