fix: consume stdout concurrently with process exit in auth login (#15058)

This commit is contained in:
Ayush Thakur
2026-02-25 18:52:52 +05:30
committed by GitHub
parent d848c9b6a3
commit 088a81c116

View File

@@ -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) {
prompts.log.error("Failed")
prompts.outro("Done")
return
}
if (!proc.stdout) {
prompts.log.error("Failed")
prompts.outro("Done")
return
}
const token = await text(proc.stdout)
const [exit, token] = await Promise.all([proc.exited, text(proc.stdout)])
if (exit !== 0) {
prompts.log.error("Failed")
prompts.outro("Done")
return
}
await Auth.set(args.url, {
type: "wellknown",
key: wellknown.auth.env,