From 46560cdeae6042d3efe6883f9ded4f4b7b8827c3 Mon Sep 17 00:00:00 2001 From: Amaru8 <52407090+Amaru8@users.noreply.github.com> Date: Fri, 13 May 2022 20:32:27 +0200 Subject: [PATCH] Create Themes and Plugins folder if it doesnt't exist Fixes #742 --- src/main/base/browserwindow.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/base/browserwindow.ts b/src/main/base/browserwindow.ts index 2a417032..5ff86506 100644 --- a/src/main/base/browserwindow.ts +++ b/src/main/base/browserwindow.ts @@ -948,13 +948,23 @@ export class BrowserWindow { switch (path) { default: case "plugins": - shell.openPath(utils.getPath("plugins")); + if (existsSync(utils.getPath("plugins"))) { + shell.openPath(utils.getPath("plugins")); + } else { + mkdirSync(utils.getPath("plugins")); + shell.openPath(utils.getPath("plugins")); + } break; case "userdata": shell.openPath(app.getPath("userData")); break; case "themes": - shell.openPath(utils.getPath("themes")); + if (existsSync(utils.getPath("themes"))) { + shell.openPath(utils.getPath("themes")); + } else { + mkdirSync(utils.getPath("themes")); + shell.openPath(utils.getPath("themes")); + } break; } });