Skip to content

Commit

Permalink
chore: Add assertions for missing Sentry environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
thecotne committed Jul 31, 2024
1 parent 629b28f commit 8475a09
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions scripts/postinstall.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import 'dotenv/config';
import fs from 'fs';
import path from 'path';
import assert from 'assert';

// Load environment variables from .env file
const {SENTRY_AUTH_TOKEN, SENTRY_DSN, SENTRY_ORG, SENTRY_PROJECT, SENTRY_URL} =
process.env;

assert(SENTRY_AUTH_TOKEN, 'Missing SENTRY_AUTH_TOKEN');
assert(SENTRY_DSN, 'Missing SENTRY_DSN');
assert(SENTRY_ORG, 'Missing SENTRY_ORG');
assert(SENTRY_PROJECT, 'Missing SENTRY_PROJECT');
assert(SENTRY_URL, 'Missing SENTRY_URL');

// Write environment variables to files
console.log('Writing environment variables to files...');

Expand Down

0 comments on commit 8475a09

Please sign in to comment.