Skip to content

Commit d22ef34

Browse files
Add support for NODE_BINARY for xcode script to collect modules (#2805)
1 parent 1478dc0 commit d22ef34

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Features
6+
7+
- 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))
8+
59
### Dependencies
610

711
- Bump Android SDK from v6.12.1 to v6.13.0 ([#2790](https://github.com/getsentry/sentry-react-native/pull/2790))

scripts/collect-modules.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ if [[ -z "$DERIVED_FILE_DIR" ]]; then
2424
fi
2525

2626
nodePath="node"
27+
if [[ -n "$NODE_BINARY" ]]; then
28+
nodePath="$NODE_BINARY"
29+
fi
30+
2731
thisFilePath=$(dirname $0)
2832
collectModulesScript="$thisFilePath/../dist/js/tools/collectModules.js"
2933

@@ -40,4 +44,11 @@ else
4044
modulesPaths="$MODULES_PATHS"
4145
fi
4246

47+
type $nodePath >/dev/null 2>&1 || {
48+
echo >&2 "error: $nodePath not found! Modules won't be collected." \
49+
"Please export NODE_BINARY in 'Build Phase' - 'Bundle React Native code and images'" \
50+
"to an absolute path of your node binary. Check your node path by 'which node'."
51+
exit 0 # Don't fail the build but inform about the problem
52+
}
53+
4354
$nodePath "$collectModulesScript" "$sourceMap" "$modulesOutput" "$modulesPaths"

0 commit comments

Comments
 (0)