From 9c90343fb82adde9068b8dd7261f9741c64afe0e Mon Sep 17 00:00:00 2001 From: Nick Dowell Date: Thu, 11 Feb 2021 09:13:19 +0000 Subject: [PATCH 1/2] Fix support for SOURCEMAP_FILE containing spaces --- scripts/react-native-xcode.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index 228a5ec885e5cc..c123a763ff502d 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -137,7 +137,7 @@ fi BUNDLE_FILE="$CONFIGURATION_BUILD_DIR/main.jsbundle" -EXTRA_ARGS= +EXTRA_ARGS=() case "$PLATFORM_NAME" in "macosx") @@ -160,12 +160,14 @@ if [[ $EMIT_SOURCEMAP == true ]]; then else PACKAGER_SOURCEMAP_FILE="$SOURCEMAP_FILE" fi - EXTRA_ARGS="$EXTRA_ARGS --sourcemap-output $PACKAGER_SOURCEMAP_FILE" + EXTRA_ARGS+=("--sourcemap-output") + EXTRA_ARGS+=("$PACKAGER_SOURCEMAP_FILE") fi # Hermes doesn't require JS minification. if [[ $USE_HERMES == true && $DEV == false ]]; then - EXTRA_ARGS="$EXTRA_ARGS --minify false" + EXTRA_ARGS+=("--minify") + EXTRA_ARGS+=("false") fi "$NODE_BINARY" $NODE_ARGS "$CLI_PATH" $BUNDLE_COMMAND \ @@ -176,7 +178,7 @@ fi --reset-cache \ --bundle-output "$BUNDLE_FILE" \ --assets-dest "$DEST" \ - $EXTRA_ARGS \ + "${EXTRA_ARGS[@]}" \ $EXTRA_PACKAGER_ARGS if [[ $USE_HERMES != true ]]; then From 9ad6e61257c6691e0325d4a1dfad51017cc0d952 Mon Sep 17 00:00:00 2001 From: Nick Dowell Date: Tue, 16 Feb 2021 10:49:40 +0000 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Nurlan Suyundukov --- scripts/react-native-xcode.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index c123a763ff502d..73affc66277b82 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -160,14 +160,12 @@ if [[ $EMIT_SOURCEMAP == true ]]; then else PACKAGER_SOURCEMAP_FILE="$SOURCEMAP_FILE" fi - EXTRA_ARGS+=("--sourcemap-output") - EXTRA_ARGS+=("$PACKAGER_SOURCEMAP_FILE") + EXTRA_ARGS+=("--sourcemap-output" "$PACKAGER_SOURCEMAP_FILE") fi # Hermes doesn't require JS minification. if [[ $USE_HERMES == true && $DEV == false ]]; then - EXTRA_ARGS+=("--minify") - EXTRA_ARGS+=("false") + EXTRA_ARGS+=("--minify" "false") fi "$NODE_BINARY" $NODE_ARGS "$CLI_PATH" $BUNDLE_COMMAND \