Skip to content

Commit

Permalink
fix: Missing .env automatically leads to dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
schw4rzlicht committed Jun 16, 2020
1 parent cf9f76b commit cc7577c
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 12 deletions.
4 changes: 0 additions & 4 deletions .ci/generate-dotenv.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
#!/usr/bin/env bash

echo "generate-dotenv.sh started!" # DEBUG

if [[ "$1" = "undefined" ]]
then
echo "Posting production to .env" # DEBUG
echo "NODE_ENV=production" > .env
else
echo "Posting staging to .env" # DEBUG
echo "NODE_ENV=staging" > .env
fi
5 changes: 0 additions & 5 deletions .ci/notify-sentry.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env bash

echo "notify-sentry.sh started!" # DEBUG

set -a
source .env
set +a
Expand All @@ -10,9 +8,6 @@ curl -sL https://sentry.io/get-cli/ | bash

export SENTRY_RELEASE=$1

echo "Content of SENTRY_RELEASE: $SENTRY_RELEASE" # DEBUG
echo "Content of NODE_ENV: $NODE_ENV" # DEBUG

sentry-cli releases new -p $SENTRY_PROJECT $SENTRY_RELEASE
sentry-cli releases set-commits $SENTRY_RELEASE --auto
sentry-cli releases files $SENTRY_RELEASE upload-sourcemaps dist
Expand Down
1 change: 0 additions & 1 deletion .env

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config.json
config.yml
.env
*.log
sentry.json
.idea
Expand Down
4 changes: 2 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ require("dotenv").config({
path: path.resolve(__dirname, ".env")
});

if(process.env.NODE_ENV === "production" && !packageInformation.version.match(/^\d+\.\d+.\d+$/)) {
process.env.NODE_ENV = "staging";
if(process.env.NODE_ENV === undefined) {
process.env.NODE_ENV = "development";
}

sentry.init(packageInformation);
Expand Down

0 comments on commit cc7577c

Please sign in to comment.