fix(cli): keep update preflight through TUI loading (#36475)
This commit is contained in:
parent
8e657c7db5
commit
e22e3b8f2c
3 changed files with 127 additions and 46 deletions
|
|
@ -17,6 +17,7 @@ export default Runtime.handler(Commands, (input) =>
|
|||
const updater = yield* Updater.Service
|
||||
yield* updater.check().pipe(Effect.forkScoped)
|
||||
const preflight = UpdatePreflight.make()
|
||||
yield* Effect.addFinalizer(() => Effect.promise(() => preflight.close()))
|
||||
const server = yield* Server.resolve({
|
||||
server: Option.getOrUndefined(input.server),
|
||||
standalone: input.standalone,
|
||||
|
|
@ -33,7 +34,7 @@ export default Runtime.handler(Commands, (input) =>
|
|||
Effect.promise(() => preflight.fail("OpenCode update could not start the new background service")),
|
||||
),
|
||||
)
|
||||
yield* Effect.promise(() => preflight.finish())
|
||||
preflight.loading()
|
||||
const config = yield* TuiConfig.load()
|
||||
let disposeSlots: (() => void) | undefined
|
||||
const runFork = Effect.runForkWith(yield* Effect.context())
|
||||
|
|
@ -41,6 +42,7 @@ export default Runtime.handler(Commands, (input) =>
|
|||
server,
|
||||
args: { continue: input.continue, sessionID: Option.getOrUndefined(input.session) },
|
||||
config,
|
||||
terminalHandoff: () => preflight.finish(),
|
||||
log: (level, message, tags) => {
|
||||
const effect =
|
||||
level === "debug"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue