Move config.js into the Shout home directory by default
This commit is contained in:
parent
7e4534afa9
commit
791a5914df
@ -187,7 +187,3 @@ module.exports = {
|
||||
certificate: ""
|
||||
}
|
||||
};
|
||||
|
||||
if ("SHOUT_CONFIG" in process.env) {
|
||||
module.exports = require(process.env.SHOUT_CONFIG);
|
||||
}
|
||||
|
@ -1,13 +1,21 @@
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
|
||||
var Helper = module.exports = {
|
||||
getConfig: function () {
|
||||
return require(path.resolve(__dirname, "..", "config"));
|
||||
var filename = process.env.SHOUT_CONFIG;
|
||||
if(!filename || !fs.exists(filename)) {
|
||||
filename = this.resolveHomePath("config.js");
|
||||
if(!fs.exists(filename)) {
|
||||
filename = path.resolve(__dirname, "..", "config");
|
||||
}
|
||||
}
|
||||
return require(filename);
|
||||
},
|
||||
|
||||
getHomeDirectory: function () {
|
||||
return (
|
||||
this.getConfig().home
|
||||
(process.env.SHOUT_CONFIG && fs.exists(process.env.SHOUT_CONFIG) && this.getConfig().home)
|
||||
|| process.env.SHOUT_HOME
|
||||
|| path.resolve(process.env.HOME, ".shout")
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user