diff options
author | Vijay A <vraravam@users.noreply.github.com> | 2022-01-02 10:41:39 +0530 |
---|---|---|
committer | Vijay A <vraravam@users.noreply.github.com> | 2022-01-02 19:34:15 +0530 |
commit | b6bf4868b3187e817b008033ac2e162c0a519473 (patch) | |
tree | 21ba85df72ad7906ed639a31eb7d3a2a59a66dd7 /packages/main | |
parent | build: Improve build configs (diff) | |
download | sophie-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>
Diffstat (limited to 'packages/main')
-rw-r--r-- | packages/main/src/index.ts | 7 |
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 | ||
51 | const isDevelopment = import.meta.env.MODE === 'development'; | 51 | const isDevelopment = import.meta.env.MODE === 'development'; |
52 | 52 | ||
53 | // Alwayse enable sandboxing. | 53 | // Always enable sandboxing. |
54 | app.enableSandbox(); | 54 | app.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. |
57 | if (isDevelopment) { | 57 | if (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 | } |
60 | ensureDirSync(app.getPath('userData')); | ||
62 | 61 | ||
63 | // Only allow a single instance at a time. | 62 | // Only allow a single instance at a time. |
64 | const isSingleInstance = app.requestSingleInstanceLock(); | 63 | const isSingleInstance = app.requestSingleInstanceLock(); |