diff --git a/packages/cli-platform-android/src/commands/buildAndroid/startServerInNewWindow.ts b/packages/cli-platform-android/src/commands/buildAndroid/startServerInNewWindow.ts index f7ff72fb1..04bf81585 100644 --- a/packages/cli-platform-android/src/commands/buildAndroid/startServerInNewWindow.ts +++ b/packages/cli-platform-android/src/commands/buildAndroid/startServerInNewWindow.ts @@ -17,7 +17,9 @@ export function startServerInNewWindow( * Set up OS-specific filenames and commands */ const isWindows = /^win/.test(process.platform); - const scriptFile = isWindows ? 'launchPackager.bat' : 'launchPackager.sh'; + const scriptFile = isWindows + ? 'launchPackager.bat' + : 'launchPackager.command'; const packagerEnvFilename = isWindows ? '.packager.bat' : '.packager.env'; const packagerEnvFileExportContent = isWindows ? `set RCT_METRO_PORT=${port}\nset PROJECT_ROOT=${projectRoot}\nset REACT_NATIVE_PATH=${reactNativePath}` @@ -59,8 +61,8 @@ export function startServerInNewWindow( ); } else { fs.copyFileSync( - path.join(cliPluginMetroPath, 'launchPackager.sh'), - path.join(nodeModulesPath, 'launchPackager.sh'), + path.join(cliPluginMetroPath, 'launchPackager.command'), + path.join(nodeModulesPath, 'launchPackager.command'), ); } } catch (error) { diff --git a/packages/cli-plugin-metro/launchPackager.sh b/packages/cli-plugin-metro/launchPackager.command similarity index 99% rename from packages/cli-plugin-metro/launchPackager.sh rename to packages/cli-plugin-metro/launchPackager.command index 0ca3e2088..5fb23c56e 100755 --- a/packages/cli-plugin-metro/launchPackager.sh +++ b/packages/cli-plugin-metro/launchPackager.command @@ -1,4 +1,5 @@ THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd) + source "$THIS_DIR/.packager.env" cd $PROJECT_ROOT $REACT_NATIVE_PATH/cli.js start