mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-16 13:05:14 +03:00
refactor(tui): drop constant mini frontend exit code (#52998)
This commit is contained in:
committed by
GitHub
Unverified
parent
bc499e4562
commit
4cb7ac9dab
@@ -33,7 +33,7 @@ class MiniInputError extends Error {}
|
||||
export async function runMini(input: MiniCommandInput) {
|
||||
try {
|
||||
validate(input)
|
||||
const result = await usingInteractiveStdin(async (terminal) => {
|
||||
await usingInteractiveStdin(async (terminal) => {
|
||||
const initialInput = mergeInput(process.stdin.isTTY ? undefined : await readStdin(), input.prompt)
|
||||
const frontendTask = import("@opencode/tui/mini")
|
||||
const directory = localDirectory()
|
||||
@@ -127,7 +127,6 @@ export async function runMini(input: MiniCommandInput) {
|
||||
config: input.config,
|
||||
})
|
||||
})
|
||||
if (result.exitCode !== 0) process.exit(result.exitCode)
|
||||
} catch (error) {
|
||||
if (error instanceof MiniInputError || (error instanceof Error && error.message === INTERACTIVE_INPUT_ERROR))
|
||||
fail(error.message)
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
import { runInteractiveDeferredMode, type RunDeferredInput } from "./runtime"
|
||||
|
||||
export type MiniFrontendInput = RunDeferredInput
|
||||
export type MiniFrontendResult = {
|
||||
exitCode: number
|
||||
}
|
||||
|
||||
export async function runMiniFrontend(input: MiniFrontendInput): Promise<MiniFrontendResult> {
|
||||
export async function runMiniFrontend(input: MiniFrontendInput): Promise<void> {
|
||||
await runInteractiveDeferredMode(input)
|
||||
return { exitCode: 0 }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user