Created
August 7, 2015 13:43
-
-
Save myndzi/f121227bd11481b70854 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var config = require('./config')('/tmp/etc/new.conf') |
This file contains hidden or 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
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