mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 22:10:22 +00:00
Check config owner synchronously
Fixes async warning printing during prompt when adding a user
This commit is contained in:
parent
a24c03a35c
commit
5d13e4c97d
1 changed files with 14 additions and 10 deletions
|
@ -40,16 +40,20 @@ if (process.getuid) {
|
|||
);
|
||||
}
|
||||
|
||||
fs.stat(path.join(Helper.getHomePath(), "config.js"), (err, stat) => {
|
||||
if (!err && stat.uid !== uid) {
|
||||
const configStat = fs.statSync(path.join(Helper.getHomePath(), "config.js"));
|
||||
|
||||
if (configStat && configStat.uid !== uid) {
|
||||
log.warn(
|
||||
"Config file owner does not match the user you are currently running The Lounge as."
|
||||
);
|
||||
log.warn(
|
||||
"To avoid issues, you should execute The Lounge commands under the same user."
|
||||
"To prevent any issues, please run thelounge commands " +
|
||||
"as the correct user that owns the config folder."
|
||||
);
|
||||
log.warn(
|
||||
"See https://thelounge.chat/docs/usage#using-the-correct-system-user for more information."
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Utils.checkOldHome();
|
||||
|
|
Loading…
Reference in a new issue