Skip to content

Instantly share code, notes, and snippets.

@itslenny
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itslenny/88238f5f40ea415cd687 to your computer and use it in GitHub Desktop.
Save itslenny/88238f5f40ea415cd687 to your computer and use it in GitHub Desktop.
a simple script that loads your foreman .env file and sets all of the environment values on heroku
/*
load_env_heroku.js
a simple script that loads your foreman .env file
and sets all of the environment values on heroku
usage:
- place this script in the root of your project
- run: node load_env_heroku.js
*/
var fs = require('fs');
var child_process = require('child_process');
fs.readFile('./.env',function(err,data){
data.toString().split('\n').forEach(function(line){
console.log('Setting ' + line + ' on heroku...');
var result = child_process.execSync('heroku config:set '+line);
console.log('result: ',result.toString());
});
console.log('');
console.log('Config values set run "heroku config" to check values.');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment