Skip to content

Commit

Permalink
Properly handle Xcode targets with spaces in their names (#42220)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
paulschreiber authored and facebook-github-bot committed Jan 10, 2024
1 parent 9155e2d commit 63e893d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/react-native/scripts/react-native-xcode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fi
PACKAGER_SOURCEMAP_FILE=
if [[ $EMIT_SOURCEMAP == true ]]; then
if [[ $USE_HERMES != false ]]; then
PACKAGER_SOURCEMAP_FILE="$CONFIGURATION_BUILD_DIR/$(basename $SOURCEMAP_FILE)"
PACKAGER_SOURCEMAP_FILE="$CONFIGURATION_BUILD_DIR/$(basename "$SOURCEMAP_FILE")"
else
PACKAGER_SOURCEMAP_FILE="$SOURCEMAP_FILE"
fi
Expand Down

0 comments on commit 63e893d

Please sign in to comment.