Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for run-android on windows. #2236

Merged
merged 2 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

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

if (startPackager) {
await startServerInNewWindow(
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