Skip to content

Commit 63e893d

Browse files
paulschreiberfacebook-github-bot
authored andcommitted
Properly handle Xcode targets with spaces in their names (#42220)
Summary: Properly handle targets with spaces in their names Use quotes around the argument to basename path. Ensures this succeeds when the Xcode target name has spaces. example: ```sh #!/bin/sh SOURCEMAP_FILE="ArchiveIntermediates/Jane Doe/IntermediateBuildFilesPath/Jane Doe.build/Release-iphoneos/JaneDoe.build/DerivedSources/main.jsbundle.map" BN_SOURCEMAP_FILE="$(basename $SOURCEMAP_FILE)" echo $BN_SOURCEMAP_FILE ``` output: ``` Jane Jane main.jsbundle.map ``` ```sh #!/bin/sh SOURCEMAP_FILE="ArchiveIntermediates/Jane Doe/IntermediateBuildFilesPath/Jane Doe.build/Release-iphoneos/JaneDoe.build/DerivedSources/main.jsbundle.map" BN_SOURCEMAP_FILE="$(basename "$SOURCEMAP_FILE")" echo $BN_SOURCEMAP_FILE ``` output: ``` main.jsbundle.map ``` ## Changelog: [iOS] [Fixed] - Fix support for SOURCEMAP_FILE path containing spaces ## Related #40937 Pull Request resolved: #42220 Reviewed By: christophpurrer Differential Revision: D52650491 Pulled By: arushikesarwani94 fbshipit-source-id: e42b8a0d018b37fb558abd53d765fbdd676c51a2
1 parent 9155e2d commit 63e893d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-native/scripts/react-native-xcode.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fi
127127
PACKAGER_SOURCEMAP_FILE=
128128
if [[ $EMIT_SOURCEMAP == true ]]; then
129129
if [[ $USE_HERMES != false ]]; then
130-
PACKAGER_SOURCEMAP_FILE="$CONFIGURATION_BUILD_DIR/$(basename $SOURCEMAP_FILE)"
130+
PACKAGER_SOURCEMAP_FILE="$CONFIGURATION_BUILD_DIR/$(basename "$SOURCEMAP_FILE")"
131131
else
132132
PACKAGER_SOURCEMAP_FILE="$SOURCEMAP_FILE"
133133
fi

0 commit comments

Comments
 (0)