Skip to content

Instantly share code, notes, and snippets.

@terrysahaidak
Created September 17, 2021 08:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save terrysahaidak/3f19aafce89556ec94fc50e42a93c701 to your computer and use it in GitHub Desktop.
Save terrysahaidak/3f19aafce89556ec94fc50e42a93c701 to your computer and use it in GitHub Desktop.
Build script for React Native Sentry with NVM
# First set the path to sentry.properties
export SENTRY_PROPERTIES=sentry.properties
# Setup nvm and set node
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"
if [[ -s "$HOME/.nvm/nvm.sh" ]]; then
. "$HOME/.nvm/nvm.sh"
elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/nvm.sh" ]]; then
. "$(brew --prefix nvm)/nvm.sh"
fi
# Set up the nodenv node version manager if present
if [[ -x "$HOME/.nodenv/bin/nodenv" ]]; then
eval "$("$HOME/.nodenv/bin/nodenv" init -)"
fi
[ -z "$NODE_BINARY" ] && export NODE_BINARY="node"
if [ "$CONFIGURATION" = "Release" ]; then
$NODE_BINARY ../node_modules/@sentry/cli/bin/sentry-cli react-native xcode \
../node_modules/react-native/scripts/react-native-xcode.sh
else
../node_modules/react-native/scripts/react-native-xcode.sh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment