0.1.7 • Published 3 years ago

set-heroku-env v0.1.7

Weekly downloads
11
License
MIT
Repository
-
Last release
3 years ago

set-heroku-env

Use this script to set environment variables from a dotenv file to Heroku.

Create a script in package.json like:

{
  "scripts": {
    "config:heroku": "set-heroku-env --dotenv=.env.heroku"
  }
}

Then run with:

# with yarn
yarn config:heroku

# with NPM
npm run config:heroku

To specify a specific Heroku app use --app otherwise it uses the default app that you set up.

{
  "scripts": {
    "config:heroku": "set-heroku-env --app=heroku-app-name --dotenv=.env.heroku"
  }
}

How It Works

  • Sets all dotenv variables with a non-empty value on Heroku using heroku config:set VAR1=VALUE1 VAR2=VALUE2
  • Unsets all dotenv variables with no value on Heroku using heroku config:unset EMPTYVAR1 EMPTYVAR2

For example:

# These will be set on Heroku
VAR1=VALUE1
VAR2=VALUE2

# These will be unset on Heroku
EMPTYVAR1=
EMPTYVAR2=
0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago