Created
August 20, 2014 00:51
-
-
Save alchemycs/d2b05333666e00569ee3 to your computer and use it in GitHub Desktop.
Run repository scripts in AWSBOX from cron or shell with environment variables
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
#!/usr/local/bin/node | |
//quick and dirty to get my scripts going quickly on awsbox from cron. Will clean this up some other time. | |
var path = require('path'); | |
var child_process = require('child_process'); | |
var configFile = path.join(process.env['HOME'], 'config.json'); | |
var config = require(configFile); | |
var env = config.env; | |
console.log('command: ',process.argv[2]); | |
child_process.exec('coffee '+process.argv[2] , { env: config.env }, function(e, stdout, stderr) { | |
console.log('Complete'); | |
console.log('Error: ', e); | |
}); | |
//console.log(config.env); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment