aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Vijay A <vraravam@users.noreply.github.com>2022-01-02 10:41:39 +0530
committerLibravatar Vijay A <vraravam@users.noreply.github.com>2022-01-02 19:34:15 +0530
commitb6bf4868b3187e817b008033ac2e162c0a519473 (patch)
tree21ba85df72ad7906ed639a31eb7d3a2a59a66dd7
parentbuild: Improve build configs (diff)
downloadsophie-b6bf4868b3187e817b008033ac2e162c0a519473.tar.gz
sophie-b6bf4868b3187e817b008033ac2e162c0a519473.tar.zst
sophie-b6bf4868b3187e817b008033ac2e162c0a519473.zip
Ensure that the 'userData' directory is present when starting up the app
Signed-off-by: Vijay A <vraravam@users.noreply.github.com>
-rw-r--r--packages/main/src/index.ts7
1 files 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';
50 50
51const isDevelopment = import.meta.env.MODE === 'development'; 51const isDevelopment = import.meta.env.MODE === 'development';
52 52
53// Alwayse enable sandboxing. 53// Always enable sandboxing.
54app.enableSandbox(); 54app.enableSandbox();
55 55
56// Use alternative directory when debugging to avoid clobbering the main installation. 56// Use alternative directory when debugging to avoid clobbering the main installation.
57if (isDevelopment) { 57if (isDevelopment) {
58 const devUserDataPath = `${app.getPath('userData')}-dev`; 58 app.setPath('userData', `${app.getPath('userData')}-dev`);
59 app.setPath('userData', devUserDataPath);
60 ensureDirSync(devUserDataPath);
61} 59}
60ensureDirSync(app.getPath('userData'));
62 61
63// Only allow a single instance at a time. 62// Only allow a single instance at a time.
64const isSingleInstance = app.requestSingleInstanceLock(); 63const isSingleInstance = app.requestSingleInstanceLock();