Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(expo): read .env file in upload script #3571

Merged
merged 6 commits into from
Jan 31, 2024
Merged
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions scripts/expo-upload-sourcemaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ function groupAssets(assetPaths) {
return groups;
}

process.env.NODE_ENV = process.env.NODE_ENV || 'development';
krystofwoldrich marked this conversation as resolved.
Show resolved Hide resolved
const projectRoot = '.'; // Assume script is run from the project root
krystofwoldrich marked this conversation as resolved.
Show resolved Hide resolved
try {
require('@expo/env').load(projectRoot);
} catch (error) {
console.warn('⚠️ Failed to load environment variables from @expo/env.');
quinlanj marked this conversation as resolved.
Show resolved Hide resolved
console.warn(error);
}

let sentryProject = getEnvVar(SENTRY_PROJECT);
let authToken = getEnvVar(SENTRY_AUTH_TOKEN);
const sentryCliBin = getEnvVar(SENTRY_CLI_EXECUTABLE) || require.resolve('@sentry/cli/bin/sentry-cli');
Expand Down
Loading