Fixes issues with bd folder
This commit is contained in:
parent
f3f15ec72c
commit
bd9b681e3f
|
@ -11,9 +11,8 @@ const buildInfoFile = path.resolve(appPath, "..", "build_info.json");
|
||||||
|
|
||||||
// Locate data path to find transparency settings
|
// Locate data path to find transparency settings
|
||||||
let dataPath = "";
|
let dataPath = "";
|
||||||
if (process.platform === "win32") dataPath = process.env.APPDATA;
|
if (process.platform === "win32" || process.platform === "darwin") dataPath = path.join(electron.app.getPath("userData"), "..");
|
||||||
else if (process.platform === "darwin") dataPath = path.join(process.env.HOME, "Library", "Preferences");
|
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
|
||||||
else dataPath = process.env.XDG_CONFIG_HOME ? process.env.XDG_CONFIG_HOME : path.join(process.env.HOME, ".config");
|
|
||||||
dataPath = path.join(dataPath, "BetterDiscord") + "/";
|
dataPath = path.join(dataPath, "BetterDiscord") + "/";
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,9 @@ export default new class DataStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
initialize() {
|
initialize() {
|
||||||
|
const bdFolderExists = fs.existsSync(Config.dataPath);
|
||||||
|
if (!bdFolderExists) fs.mkdirSync(Config.dataPath);
|
||||||
|
|
||||||
const newStorageExists = fs.existsSync(this.baseFolder);
|
const newStorageExists = fs.existsSync(this.baseFolder);
|
||||||
if (!newStorageExists) fs.mkdirSync(this.baseFolder);
|
if (!newStorageExists) fs.mkdirSync(this.baseFolder);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue