Skip to content

Commit 0e8cf75

Browse files
authored
Improve Quotation and Path Handling in CLI Tools (#2238)
1 parent f22be6d commit 0e8cf75

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/cli-tools/src/launchPackager.command

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
44

55
source "$THIS_DIR/.packager.env"
6-
cd $PROJECT_ROOT
7-
$REACT_NATIVE_PATH/cli.js start --port $RCT_METRO_PORT
6+
cd "$PROJECT_ROOT"
7+
"$REACT_NATIVE_PATH/cli.js" start --port $RCT_METRO_PORT
88

99
if [[ -z "$CI" ]]; then
1010
echo "Process terminated. Press <enter> to close the window"

packages/cli-tools/src/startServerInNewWindow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function startServerInNewWindow(
2727
const packagerEnvFilename = isWindows ? '.packager.bat' : '.packager.env';
2828
const packagerEnvFileExportContent = isWindows
2929
? `set RCT_METRO_PORT=${port}\nset PROJECT_ROOT=${projectRoot}\nset REACT_NATIVE_PATH=${reactNativePath}`
30-
: `export RCT_METRO_PORT=${port}\nexport PROJECT_ROOT=${projectRoot}\nexport REACT_NATIVE_PATH=${reactNativePath}`;
30+
: `export RCT_METRO_PORT=${port}\nexport PROJECT_ROOT="${projectRoot}"\nexport REACT_NATIVE_PATH="${reactNativePath}"`;
3131
const nodeModulesPath = resolveNodeModuleDir(projectRoot, '.bin');
3232
const cliPluginMetroPath = path.join(
3333
path.dirname(

0 commit comments

Comments
 (0)