diff --git a/.envrc b/.envrc index 102229cb343d4a..633e510061bb28 100644 --- a/.envrc +++ b/.envrc @@ -43,7 +43,8 @@ report_to_sentry() { if ! require sentry-cli; then curl -sL https://sentry.io/get-cli/ | bash fi - sentry-cli send-event -m "$error_message" --logfile "$_SENTRY_LOG_FILE" --level $log_level + SENTRY_DSN=${SENTRY_DEVENV_DSN} \ + sentry-cli send-event -m "$error_message" --logfile "$_SENTRY_LOG_FILE" --level $log_level rm "$_SENTRY_LOG_FILE" } @@ -125,12 +126,19 @@ export NODE_OPTIONS=--max-old-space-size=4096 # Enable this by default for development envs (CI/deploys do not use envrc) export SENTRY_UI_HOT_RELOAD=1 +### You can override the exported variables with a .env file +# All exports should happen before here unless they're safeguarded (see devenv error reporting below) +if [ -f '.env' ]; then + info ".env found. Reading it..." + dotenv .env +fi + ## Notify of reporting to Sentry if [ -n "${SENTRY_DEVENV_NO_REPORT+x}" ]; then info "No development environment errors will be reported (since you've defined SENTRY_DEVENV_NO_REPORT)." else info "Development errors will be reported to Sentry.io."$'\n'" If you wish to opt-out, set SENTRY_DEVENV_NO_REPORT as an env variable." - export SENTRY_DSN=https://23670f54c6254bfd9b7de106637808e9@o1.ingest.sentry.io/1492057 + export SENTRY_DEVENV_DSN=https://23670f54c6254bfd9b7de106637808e9@o1.ingest.sentry.io/1492057 fi ### System ### @@ -217,11 +225,6 @@ PATH_add node_modules/.bin ### Overrides ### -if [ -f '.env' ]; then - info ".env found. Reading it..." - dotenv .env -fi - cat <