This commit is contained in:
Johannes7k75 2024-03-24 17:37:18 +01:00 committed by GitHub
commit 4ef0b99636
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -13,6 +13,10 @@ const buildInfoFile = path.resolve(appPath, "..", "build_info.json");
// Locate data path to find transparency settings
let dataPath = "";
if (process.platform === "win32" || process.platform === "darwin") dataPath = path.join(electron.app.getPath("userData"), "..");
if (process.argv.filter((arg) => arg.startsWith("--bd-data-dir")).length > 0)
dataPath = process.argv.filter((arg) => arg.startsWith("--bd-data-dir"))[0].split("=")[1];
else if (process.platform === "win32" || process.platform === "darwin")
dataPath = path.join(electron.app.getPath("userData"), "..");
else dataPath = process.env.XDG_CONFIG_HOME ? process.env.XDG_CONFIG_HOME : path.join(process.env.HOME, ".config"); // This will help with snap packages eventually
dataPath = path.join(dataPath, "BetterDiscord") + "/";
@ -126,4 +130,4 @@ if (BetterDiscord.getSetting("developer", "reactDevTools")) {
electron.app.whenReady().then(async ()=>{
await ReactDevTools.install(dataPath);
});
}
}