Last active
August 29, 2015 14:27
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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