Skip to content

Commit 6c7e02f

Browse files
committed
Fixed a problem with writing to files
The logins.json file is now created with write permissions
1 parent 33b2fc1 commit 6c7e02f

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

js/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ let barry = false;
3030

3131
// Disable the security warning from electron that comes from using an uncompiled version
3232
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = true;
33+
// Set the permissions umask to 0, allowing writing to files using the exact specified permissions
34+
process.umask(0);
3335
// Allows LiveBot to work as an executable
3436
process.chdir(__dirname);
3537
// Display that LiveBot has started

js/userSettings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ let settings = {
9898
set settings(args) {
9999
let settings = this.settings;
100100
settings = { ...settings, ...args };
101-
fs.writeFileSync("json/logins.json", JSON.stringify(settings));
101+
fs.writeFileSync("json/logins.json", JSON.stringify(settings), {mode: parseInt('0666', 8)});
102102
},
103103

104104
set rawSettings(args) {

0 commit comments

Comments
 (0)