Installation
npm i -g heroku-set-env
#or
yarn global add heroku-set-env
Usage
You need to login Heroku CLI first. Run heroku login
if you are not logged in.
$ heroku-set-env --help
Usage
$ heroku-set-env -a "your-app-name"
Options
--app -a App name of heroku project (required)
--path -p Path of .env file (optional)
--help
Example
$ heroku-set-env -a example-project
$ heroku-set-env -a example-project -p .env.example
Example
npm i --save-dev heroku-set-env
then set script in package.json
{
...
"scripts":{
...
"heroku-config": "heroku-set-env -a your-app-name -p .env.heroku"
}
}
then run script
npm run heroku-config
then all vars in .env.heroku set to the your Heroku project.