diff options
| author | Ayush Thakur <[email protected]> | 2026-02-25 18:52:52 +0530 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-02-25 08:22:52 -0500 |
| commit | 088a81c116f3fda865851292c92754385292b92d (patch) | |
| tree | c869729da94b20c15958c6bee4840aeef6bb4735 | |
| parent | d848c9b6a32f408e8b9bf6448b83af05629454d0 (diff) | |
| download | opencode-088a81c116f3fda865851292c92754385292b92d.tar.gz opencode-088a81c116f3fda865851292c92754385292b92d.zip | |
fix: consume stdout concurrently with process exit in auth login (#15058)
| -rw-r--r-- | packages/opencode/src/cli/cmd/auth.ts | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/packages/opencode/src/cli/cmd/auth.ts b/packages/opencode/src/cli/cmd/auth.ts index 4a97a5e0b..956359164 100644 --- a/packages/opencode/src/cli/cmd/auth.ts +++ b/packages/opencode/src/cli/cmd/auth.ts @@ -268,18 +268,17 @@ export const AuthLoginCommand = cmd({ const proc = Process.spawn(wellknown.auth.command, { stdout: "pipe", }) - const exit = await proc.exited - if (exit !== 0) { + if (!proc.stdout) { prompts.log.error("Failed") prompts.outro("Done") return } - if (!proc.stdout) { + const [exit, token] = await Promise.all([proc.exited, text(proc.stdout)]) + if (exit !== 0) { prompts.log.error("Failed") prompts.outro("Done") return } - const token = await text(proc.stdout) await Auth.set(args.url, { type: "wellknown", key: wellknown.auth.env, |
