diff --git a/CHANGELOG.md b/CHANGELOG.md index d8dcb7a417..b8cfa310e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ ### Fixes +- Sentry Module Collection Script Fails with Spaces in Node Path on iOS ([#4559](https://github.com/getsentry/sentry-react-native/pull/4559)) - Various crashes and issues of Session Replay on Android. See the Android SDK version bump for more details. ([#4529](https://github.com/getsentry/sentry-react-native/pull/4529)) ### Dependencies diff --git a/packages/core/scripts/collect-modules.sh b/packages/core/scripts/collect-modules.sh index 419d2e4ac2..975a4bb137 100755 --- a/packages/core/scripts/collect-modules.sh +++ b/packages/core/scripts/collect-modules.sh @@ -28,7 +28,7 @@ if [[ -n "$NODE_BINARY" ]]; then nodePath="$NODE_BINARY" fi -thisFilePath=$(dirname $0) +thisFilePath=$(dirname "$0") collectModulesScript="$thisFilePath/../dist/js/tools/collectModules.js" destination="$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH" @@ -44,11 +44,11 @@ else modulesPaths="$MODULES_PATHS" fi -type $nodePath >/dev/null 2>&1 || { +if ! command -v "$nodePath" >/dev/null 2>&1; then echo >&2 "error: $nodePath not found! Modules won't be collected." \ "Please export NODE_BINARY in 'Build Phase' - 'Bundle React Native code and images'" \ "to an absolute path of your node binary. Check your node path by 'which node'." exit 0 # Don't fail the build but inform about the problem -} +fi -$nodePath "$collectModulesScript" "$sourceMap" "$modulesOutput" "$modulesPaths" +"$nodePath" "$collectModulesScript" "$sourceMap" "$modulesOutput" "$modulesPaths"