From b6bf4868b3187e817b008033ac2e162c0a519473 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Sun, 2 Jan 2022 10:41:39 +0530 Subject: Ensure that the 'userData' directory is present when starting up the app Signed-off-by: Vijay A --- packages/main/src/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts index 7c6bfd5..0e7c36b 100644 --- a/packages/main/src/index.ts +++ b/packages/main/src/index.ts @@ -50,15 +50,14 @@ import { createMainStore } from './stores/MainStore.js'; const isDevelopment = import.meta.env.MODE === 'development'; -// Alwayse enable sandboxing. +// Always enable sandboxing. app.enableSandbox(); // Use alternative directory when debugging to avoid clobbering the main installation. if (isDevelopment) { - const devUserDataPath = `${app.getPath('userData')}-dev`; - app.setPath('userData', devUserDataPath); - ensureDirSync(devUserDataPath); + app.setPath('userData', `${app.getPath('userData')}-dev`); } +ensureDirSync(app.getPath('userData')); // Only allow a single instance at a time. const isSingleInstance = app.requestSingleInstanceLock(); -- cgit v1.2.3-54-g00ecf