Skip to content

Commit

Permalink
fix(discord): log files being created on home directory
Browse files Browse the repository at this point in the history
  • Loading branch information
diogotcorreia committed Dec 27, 2024
1 parent d13ccae commit e203da9
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
33 changes: 33 additions & 0 deletions overlays/discord/0003-fix-log-path.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
diff --git a/src/paths.js b/src/paths.js
index 1cc5ca7..d8c71aa 100644
--- a/src/paths.js
+++ b/src/paths.js
@@ -4,7 +4,7 @@ const { app } = require('electron');

const buildInfo = require('./utils/buildInfo');

-let userData, userDataVersioned, resourcesPath, moduleData, exeDir, installPath;
+let userData, userDataVersioned, resourcesPath, moduleData, exeDir, installPath, logPath;

exports.getUserData = () => userData;
exports.getUserDataVersioned = () => userDataVersioned;
@@ -12,6 +12,7 @@ exports.getUserDataVersioned = () => userDataVersioned;
exports.getResources = () => resourcesPath;
exports.getModuleDataPath = () => moduleData;
exports.getInstallPath = () => installPath;
+exports.getLogPath = () => logPath;

exports.getExeDir = () => exeDir;

@@ -26,7 +27,9 @@ exports.init = () => {

moduleData = buildInfo.newUpdater ? join(userData, 'module_data') : join(userDataVersioned, 'modules');
resourcesPath = join(process.resourcesPath);
+ logPath = join(userData, 'logs');

global.moduleDataPath = moduleData; // Global because discord
+ global.logPath = logPath; // Global because discord
app.setPath('userData', userData); // Set userData properly because electron
-};
\ No newline at end of file
+};
2 changes: 2 additions & 0 deletions overlays/discord/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
patches = [
./0001-openasar-override-settings-file.diff
./0002-openasar-allow-skip-quickstart.diff
# https://github.com/GooseMod/OpenAsar/issues/202
./0003-fix-log-path.diff
];
});
}

0 comments on commit e203da9

Please sign in to comment.