Merge pull request #1785 from thelounge/astorije/fix-home-fie-rename

Do not rename home file as it is very likely to have permission issues
This commit is contained in:
Pavel Djundik 2017-12-01 11:49:11 +02:00 committed by GitHub
commit 9d87ce5d7a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,12 +23,7 @@ class Utils {
return home;
}
const distConfig = path.resolve(path.join(
__dirname,
"..",
"..",
".thelounge_home"
));
let distConfig;
// TODO: Remove this section when releasing The Lounge v3
const deprecatedDistConfig = path.resolve(path.join(
@ -39,9 +34,16 @@ class Utils {
));
if (fs.existsSync(deprecatedDistConfig)) {
log.warn(`${colors.green(".lounge_home")} is ${colors.bold("deprecated")} and will be ignored as of The Lounge v3.`);
log.warn(`Renaming to ${colors.green(".thelounge_home")} instead.`);
log.warn(`Use ${colors.green(".thelounge_home")} instead.`);
fs.renameSync(deprecatedDistConfig, distConfig);
distConfig = deprecatedDistConfig;
} else {
distConfig = path.resolve(path.join(
__dirname,
"..",
"..",
".thelounge_home"
));
}
home = fs.readFileSync(distConfig, "utf-8").trim();