Skip to content

Instantly share code, notes, and snippets.

@myndzi
Created August 7, 2015 13:43
Show Gist options
  • Save myndzi/f121227bd11481b70854 to your computer and use it in GitHub Desktop.
Save myndzi/f121227bd11481b70854 to your computer and use it in GitHub Desktop.
var config = require('./config')('/tmp/etc/new.conf')
var fs = require('fs');
module.exports = function (FILEPATH) {
var config = { };
try {
if (fs.existsSync(FILEPATH)) {
var poolEnv = fs.readFileSync(FILEPATH, {encoding: 'utf8'});
if (typeof poolEnv === 'string' && poolEnv.length) {
poolEnv = poolEnv.replace(rtrim, '');
if(poolEnv === 'curr') {
config.env = 'production'
} else if(poolEnv === 'next') {
config.env = 'stage'
}
config.configDir = '/tmp/iot';
}
}
} catch (err) {
console.log("Error reading new.conf file");
}
return config;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment