From 3aa0bb806eacf7dd0fff6288aadf540fa78602c3 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 23 Oct 2025 02:53:13 +0200 Subject: [PATCH] fix some ENOENT errors on first launch --- src/main/constants.ts | 1 + src/main/firstLaunch.ts | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/constants.ts b/src/main/constants.ts index d8ecc85..458e11b 100644 --- a/src/main/constants.ts +++ b/src/main/constants.ts @@ -26,6 +26,7 @@ export const SESSION_DATA_DIR = join(DATA_DIR, "sessionData"); app.setPath("sessionData", SESSION_DATA_DIR); export const VENCORD_SETTINGS_DIR = join(DATA_DIR, "settings"); +mkdirSync(VENCORD_SETTINGS_DIR, { recursive: true }); export const VENCORD_QUICKCSS_FILE = join(VENCORD_SETTINGS_DIR, "quickCss.css"); export const VENCORD_SETTINGS_FILE = join(VENCORD_SETTINGS_DIR, "settings.json"); export const VENCORD_THEMES_DIR = join(DATA_DIR, "themes"); diff --git a/src/main/firstLaunch.ts b/src/main/firstLaunch.ts index d926f81..a84d689 100644 --- a/src/main/firstLaunch.ts +++ b/src/main/firstLaunch.ts @@ -63,7 +63,12 @@ export function createFirstLaunchTour() { copyFileSync(join(from, file), join(to, file)); } } catch (e) { - console.error("Failed to import settings:", e); + if (e instanceof Error && "code" in e && e.code === "ENOENT") { + console.log("No Vencord settings found to import."); + return; + } + + console.error("Failed to import Vencord settings:", e); } }