Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

### Fixes

- Warnings when .env.sentry-build-plugin is not set on Sentry/CLI ([#5029](https://github.com/getsentry/sentry-react-native/pull/5029))
- Fix for `sentry-cli` path discovery not working on Android ([#5009](https://github.com/getsentry/sentry-react-native/pull/5009))
- Export `addIntegration` from `@sentry/core` ([#5020](https://github.com/getsentry/sentry-react-native/pull/5020))

Expand Down
5 changes: 4 additions & 1 deletion packages/core/scripts/expo-upload-sourcemaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,10 @@ try {
console.warn(error);
}

loadDotenv(path.join(projectRoot, '.env.sentry-build-plugin'));
const sentryBuildPluginPath = path.join(projectRoot, '.env.sentry-build-plugin');
if (fs.existsSync(sentryBuildPluginPath)) {
loadDotenv();
}

let sentryOrg = getEnvVar(SENTRY_ORG);
let sentryUrl = getEnvVar(SENTRY_URL);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/scripts/sentry-xcode-debug-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ LOCAL_NODE_BINARY=${NODE_BINARY:-node}
RN_PROJECT_ROOT="${PROJECT_DIR}/.."

[ -z "$SENTRY_PROPERTIES" ] && export SENTRY_PROPERTIES=sentry.properties
[ -z "$SENTRY_DOTENV_PATH" ] && export SENTRY_DOTENV_PATH="$RN_PROJECT_ROOT/.env.sentry-build-plugin"
[ -z "$SENTRY_DOTENV_PATH" ] && [ -f "$RN_PROJECT_ROOT/.env.sentry-build-plugin" ] && export SENTRY_DOTENV_PATH="$RN_PROJECT_ROOT/.env.sentry-build-plugin"

[ -z "$SENTRY_CLI_EXECUTABLE" ] && SENTRY_CLI_PACKAGE_PATH=$("$LOCAL_NODE_BINARY" --print "require('path').dirname(require.resolve('@sentry/cli/package.json'))")
[ -z "$SOURCEMAP_FILE" ] && export SOURCEMAP_FILE="$DERIVED_FILE_DIR/main.jsbundle.map"
Expand Down
2 changes: 1 addition & 1 deletion packages/core/scripts/sentry-xcode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ LOCAL_NODE_BINARY=${NODE_BINARY:-node}
RN_PROJECT_ROOT="${PROJECT_DIR}/.."

[ -z "$SENTRY_PROPERTIES" ] && export SENTRY_PROPERTIES=sentry.properties
[ -z "$SENTRY_DOTENV_PATH" ] && export SENTRY_DOTENV_PATH="$RN_PROJECT_ROOT/.env.sentry-build-plugin"
[ -z "$SENTRY_DOTENV_PATH" ] && [ -f "$RN_PROJECT_ROOT/.env.sentry-build-plugin" ] && export SENTRY_DOTENV_PATH="$RN_PROJECT_ROOT/.env.sentry-build-plugin"
[ -z "$SOURCEMAP_FILE" ] && export SOURCEMAP_FILE="$DERIVED_FILE_DIR/main.jsbundle.map"

if [ -z "$SENTRY_CLI_EXECUTABLE" ]; then
Expand Down
2 changes: 1 addition & 1 deletion packages/core/sentry.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ project.afterEvaluate {

project.logger.lifecycle("Sentry-CLI arguments: ${args}")
def osCompatibility = Os.isFamily(Os.FAMILY_WINDOWS) ? ['cmd', '/c', 'node'] : []
if (!System.getenv('SENTRY_DOTENV_PATH')) {
if (!System.getenv('SENTRY_DOTENV_PATH') && file("$reactRoot/.env.sentry-build-plugin").exists()) {
environment('SENTRY_DOTENV_PATH', "$reactRoot/.env.sentry-build-plugin")
}
commandLine(*osCompatibility, *args)
Expand Down
Loading