2017-08-21 05:49:32 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const colors = require("colors/safe");
|
2017-08-21 06:03:40 +00:00
|
|
|
const fs = require("fs");
|
|
|
|
const path = require("path");
|
|
|
|
|
|
|
|
let loungeHome;
|
2017-08-21 05:49:32 +00:00
|
|
|
|
|
|
|
class Utils {
|
|
|
|
static extraHelp() {
|
|
|
|
[
|
|
|
|
"",
|
|
|
|
"",
|
|
|
|
" Environment variable:",
|
|
|
|
"",
|
2017-08-21 06:03:40 +00:00
|
|
|
` LOUNGE_HOME Path for all configuration files and folders. Defaults to ${colors.green(Utils.defaultLoungeHome())}.`,
|
2017-08-21 05:49:32 +00:00
|
|
|
"",
|
|
|
|
].forEach((e) => console.log(e));
|
|
|
|
}
|
2017-08-21 06:03:40 +00:00
|
|
|
|
|
|
|
static defaultLoungeHome() {
|
|
|
|
if (loungeHome) {
|
|
|
|
return loungeHome;
|
|
|
|
}
|
|
|
|
const distConfig = path.resolve(path.join(
|
|
|
|
__dirname,
|
|
|
|
"..",
|
|
|
|
"..",
|
|
|
|
".lounge_home"
|
|
|
|
));
|
|
|
|
|
|
|
|
loungeHome = fs.readFileSync(distConfig, "utf-8").trim();
|
|
|
|
|
|
|
|
return loungeHome;
|
|
|
|
}
|
2017-08-21 05:49:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = Utils;
|