Skip to content

Commit

Permalink
Add support for NODE_BINARY for xcode script to collect modules (#2805)
Browse files Browse the repository at this point in the history
  • Loading branch information
krystofwoldrich authored Feb 3, 2023
1 parent 1478dc0 commit d22ef34
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
11 changes: 11 additions & 0 deletions scripts/collect-modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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"

0 comments on commit d22ef34

Please sign in to comment.