Allow customising SettingsDir via VENCORD_USER_DATA_DIR environment variable (#106)

This commit is contained in:
Kyiro 2022-10-16 23:20:43 +02:00 committed by GitHub
parent 0ccea16453
commit c7c5ffdd44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,11 @@ import IpcEvents from "../utils/IpcEvents";
import "./updater";
const DATA_DIR = join(app.getPath("userData"), "..", "Vencord");
const DATA_DIR = process.env.VENCORD_USER_DATA_DIR ?? (
process.env.DISCORD_USER_DATA_DIR
? join(process.env.DISCORD_USER_DATA_DIR, "..", "VencordData")
: join(app.getPath("userData"), "..", "Vencord")
);
const SETTINGS_DIR = join(DATA_DIR, "settings");
const QUICKCSS_PATH = join(SETTINGS_DIR, "quickCss.css");
const SETTINGS_FILE = join(SETTINGS_DIR, "settings.json");