Skip to content

Commit

Permalink
fix(gpt-runner-cli): fix cli can not auto open in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
2214962083 committed Aug 15, 2023
1 parent ff75480 commit 3944dda
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/gpt-runner-cli/src/cli-start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,10 @@ export async function startCli(cwd = PathUtils.resolve(process.cwd()), argv = pr
autoFreePort: true,
})

let startServerPromise: Promise<any> | undefined

try {
await execa('node', [startServerJsPath, '--port', String(finalPort)], {
startServerPromise = execa('node', [startServerJsPath, '--port', String(finalPort)], {
env: {
...process.env,
...getRunServerEnv(),
Expand Down Expand Up @@ -114,6 +116,8 @@ export async function startCli(cwd = PathUtils.resolve(process.cwd()), argv = pr
})

afterServerStartSuccess()

await startServerPromise
}
catch (error) {
consola.error(error)
Expand Down

0 comments on commit 3944dda

Please sign in to comment.