2014-09-13 12:23:17 +00:00
|
|
|
var path = require("path");
|
|
|
|
|
|
|
|
var Helper = module.exports = {
|
2014-09-13 17:10:32 +00:00
|
|
|
getConfig: function () {
|
|
|
|
return require(path.resolve(__dirname, "..", "config"));
|
|
|
|
},
|
2014-09-13 12:23:17 +00:00
|
|
|
|
2014-09-13 17:10:32 +00:00
|
|
|
getHomeDirectory: function () {
|
|
|
|
return (
|
|
|
|
this.getConfig().home
|
|
|
|
|| process.env.SHOUT_HOME
|
|
|
|
|| path.resolve(process.env.HOME, ".shout")
|
|
|
|
);
|
|
|
|
},
|
2014-09-13 12:23:17 +00:00
|
|
|
|
2014-09-13 17:10:32 +00:00
|
|
|
resolveHomePath: function () {
|
|
|
|
var fragments = [ Helper.HOME ].concat([].slice.apply(arguments));
|
|
|
|
return path.resolve.apply(path, fragments);
|
|
|
|
}
|
2014-09-13 12:23:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
Helper.HOME = Helper.getHomeDirectory()
|