fully rename app to Vesktop
This commit is contained in:
@@ -5,9 +5,25 @@
|
||||
*/
|
||||
|
||||
import { app } from "electron";
|
||||
import { existsSync, readdirSync, renameSync, rmdirSync } from "fs";
|
||||
import { join } from "path";
|
||||
|
||||
export const DATA_DIR = process.env.VENCORD_USER_DATA_DIR || join(app.getPath("userData"), "VencordDesktop");
|
||||
const LEGACY_DATA_DIR = join(app.getPath("appData"), "VencordDesktop", "VencordDesktop");
|
||||
export const DATA_DIR = process.env.VENCORD_USER_DATA_DIR || join(app.getPath("userData"));
|
||||
// TODO: remove eventually
|
||||
if (existsSync(LEGACY_DATA_DIR)) {
|
||||
try {
|
||||
console.warn("Detected legacy settings dir", LEGACY_DATA_DIR + ".", "migrating to", DATA_DIR);
|
||||
for (const file of readdirSync(LEGACY_DATA_DIR)) {
|
||||
renameSync(join(LEGACY_DATA_DIR, file), join(DATA_DIR, file));
|
||||
}
|
||||
rmdirSync(LEGACY_DATA_DIR);
|
||||
} catch (e) {
|
||||
console.error("Migration failed", e);
|
||||
}
|
||||
}
|
||||
app.setPath("sessionData", join(DATA_DIR, "sessionData"));
|
||||
|
||||
export const VENCORD_SETTINGS_DIR = join(DATA_DIR, "settings");
|
||||
export const VENCORD_QUICKCSS_FILE = join(VENCORD_SETTINGS_DIR, "quickCss.css");
|
||||
export const VENCORD_SETTINGS_FILE = join(VENCORD_SETTINGS_DIR, "settings.json");
|
||||
|
||||
@@ -210,7 +210,6 @@ function initMenuBar(win: BrowserWindow) {
|
||||
type: "separator"
|
||||
},
|
||||
{
|
||||
label: "Hide Vesktop", // Should probably remove the label, but it says "Hide VencordDesktop" instead of "Hide Vesktop"
|
||||
role: "hide"
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user