aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kristof@marussy.com>2022-01-02 14:18:58 +0000
committerLibravatar Kristóf Marussy <kristof@marussy.com>2022-01-02 14:18:58 +0000
commitba4bbb46368e66cca3300455ccdcb774822bc855 (patch)
tree21ba85df72ad7906ed639a31eb7d3a2a59a66dd7
parentbuild: Improve build configs (diff)
parentEnsure that the 'userData' directory is present when starting up the app (diff)
downloadsophie-ba4bbb46368e66cca3300455ccdcb774822bc855.tar.gz
sophie-ba4bbb46368e66cca3300455ccdcb774822bc855.tar.zst
sophie-ba4bbb46368e66cca3300455ccdcb774822bc855.zip
Merge branch 'ensure-userDataDir-present' into 'main'
Ensure that the 'userData' directory is present when starting up the app See merge request say-hi-to-sophie/sophie!1
-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();