Skip to content

Commit 3944dda

Browse files
committed
fix(gpt-runner-cli): fix cli can not auto open in browser
1 parent ff75480 commit 3944dda

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/gpt-runner-cli/src/cli-start.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ export async function startCli(cwd = PathUtils.resolve(process.cwd()), argv = pr
5656
autoFreePort: true,
5757
})
5858

59+
let startServerPromise: Promise<any> | undefined
60+
5961
try {
60-
await execa('node', [startServerJsPath, '--port', String(finalPort)], {
62+
startServerPromise = execa('node', [startServerJsPath, '--port', String(finalPort)], {
6163
env: {
6264
...process.env,
6365
...getRunServerEnv(),
@@ -114,6 +116,8 @@ export async function startCli(cwd = PathUtils.resolve(process.cwd()), argv = pr
114116
})
115117

116118
afterServerStartSuccess()
119+
120+
await startServerPromise
117121
}
118122
catch (error) {
119123
consola.error(error)

0 commit comments

Comments
 (0)