Skip to content

Commit

Permalink
Improve Quotation and Path Handling in CLI Tools (#2238)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowleopard17 authored Jan 3, 2024
1 parent f22be6d commit 0e8cf75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/cli-tools/src/launchPackager.command
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
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 --port $RCT_METRO_PORT
cd "$PROJECT_ROOT"
"$REACT_NATIVE_PATH/cli.js" start --port $RCT_METRO_PORT

if [[ -z "$CI" ]]; then
echo "Process terminated. Press <enter> to close the window"
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 @@ -27,7 +27,7 @@ function startServerInNewWindow(
const packagerEnvFilename = isWindows ? '.packager.bat' : '.packager.env';
const packagerEnvFileExportContent = isWindows
? `set RCT_METRO_PORT=${port}\nset PROJECT_ROOT=${projectRoot}\nset REACT_NATIVE_PATH=${reactNativePath}`
: `export RCT_METRO_PORT=${port}\nexport PROJECT_ROOT=${projectRoot}\nexport REACT_NATIVE_PATH=${reactNativePath}`;
: `export RCT_METRO_PORT=${port}\nexport PROJECT_ROOT="${projectRoot}"\nexport REACT_NATIVE_PATH="${reactNativePath}"`;
const nodeModulesPath = resolveNodeModuleDir(projectRoot, '.bin');
const cliPluginMetroPath = path.join(
path.dirname(
Expand Down

0 comments on commit 0e8cf75

Please sign in to comment.