diff --git a/CHANGELOG.md b/CHANGELOG.md index 52c8ceea06..f04385b5e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Features + +- Collect modules script for XCode builds supports NODE_BINARY to set path to node executable ([#2805](https://github.com/getsentry/sentry-react-native/pull/2805)) + ### Dependencies - Bump Android SDK from v6.12.1 to v6.13.0 ([#2790](https://github.com/getsentry/sentry-react-native/pull/2790)) diff --git a/scripts/collect-modules.sh b/scripts/collect-modules.sh index 59a9c59012..419d2e4ac2 100755 --- a/scripts/collect-modules.sh +++ b/scripts/collect-modules.sh @@ -24,6 +24,10 @@ if [[ -z "$DERIVED_FILE_DIR" ]]; then fi nodePath="node" +if [[ -n "$NODE_BINARY" ]]; then + nodePath="$NODE_BINARY" +fi + thisFilePath=$(dirname $0) collectModulesScript="$thisFilePath/../dist/js/tools/collectModules.js" @@ -40,4 +44,11 @@ else modulesPaths="$MODULES_PATHS" fi +type $nodePath >/dev/null 2>&1 || { + 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 +} + $nodePath "$collectModulesScript" "$sourceMap" "$modulesOutput" "$modulesPaths"