aboutsummaryrefslogtreecommitdiff
path: root/src/ipcMain.ts
diff options
context:
space:
mode:
authorVendicated <vendicated@riseup.net>2022-09-02 04:55:03 +0200
committerVendicated <vendicated@riseup.net>2022-09-02 04:55:14 +0200
commit138682f3eb28cfc76ef8cb5128f2537f00821e90 (patch)
tree8ee4b6f42b058f104b6b8c03b498335c1502ed18 /src/ipcMain.ts
parenteef407e9917f3dcebed96e92651d4a997bb24ad2 (diff)
downloadVencord-138682f3eb28cfc76ef8cb5128f2537f00821e90.tar.gz
Vencord-138682f3eb28cfc76ef8cb5128f2537f00821e90.tar.bz2
Vencord-138682f3eb28cfc76ef8cb5128f2537f00821e90.zip
Fix: Create SETTINGS_DIR if it doesnt exist
Diffstat (limited to 'src/ipcMain.ts')
-rw-r--r--src/ipcMain.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ipcMain.ts b/src/ipcMain.ts
index 80bff55..a35b248 100644
--- a/src/ipcMain.ts
+++ b/src/ipcMain.ts
@@ -1,5 +1,5 @@
import { app, BrowserWindow, ipcMain, shell } from "electron";
-import { readFileSync, watch } from "fs";
+import { mkdirSync, readFileSync, watch } from "fs";
import { open, readFile, writeFile } from "fs/promises";
import { join } from 'path';
import IpcEvents from './utils/IpcEvents';
@@ -9,6 +9,8 @@ const SETTINGS_DIR = join(DATA_DIR, "settings");
const QUICKCSS_PATH = join(SETTINGS_DIR, "quickCss.css");
const SETTINGS_FILE = join(SETTINGS_DIR, "settings.json");
+mkdirSync(SETTINGS_DIR, { recursive: true });
+
function readCss() {
return readFile(QUICKCSS_PATH, "utf-8").catch(() => "");
}