Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ async function runAndroid(_argv: Array<string>, config: Config, args: Flags) {
);

if (startPackager) {
await startServerInNewWindow(
// Awaiting this causes the CLI to hang indefinitely, so this must execute without await.
startServerInNewWindow(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mind also adding comment why awaiting this function breaks things?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

newPort,
config.root,
config.reactNativePath,
Expand Down
4 changes: 4 additions & 0 deletions packages/cli-tools/src/getDefaultUserTerminal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ const getDefaultUserTerminal = (): string | undefined => {
return TERM_PROGRAM;
}

if (os.platform() === 'win32') {
return 'cmd.exe';
}

return TERM;
};

Expand Down
2 changes: 1 addition & 1 deletion packages/cli-tools/src/startServerInNewWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function startServerInNewWindow(
}
if (isWindows) {
// Awaiting this causes the CLI to hang indefinitely, so this must execute without await.
return execa('cmd.exe', ['/C', launchPackagerScript], {
return execa(terminal, ['/C', launchPackagerScript], {
...procConfig,
detached: true,
stdio: 'ignore',
Expand Down