thelounge/src/helper.js
Mattias Erming b3b36282aa Refactoring
2014-09-13 10:10:32 -07:00

23 lines
500 B
JavaScript

var path = require("path");
var Helper = module.exports = {
getConfig: function () {
return require(path.resolve(__dirname, "..", "config"));
},
getHomeDirectory: function () {
return (
this.getConfig().home
|| process.env.SHOUT_HOME
|| path.resolve(process.env.HOME, ".shout")
);
},
resolveHomePath: function () {
var fragments = [ Helper.HOME ].concat([].slice.apply(arguments));
return path.resolve.apply(path, fragments);
}
};
Helper.HOME = Helper.getHomeDirectory()