diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/main/package.json | 1 | ||||
-rw-r--r-- | packages/main/src/index.ts | 7 |
2 files changed, 5 insertions, 3 deletions
diff --git a/packages/main/package.json b/packages/main/package.json index f4cf18b..3b3e45c 100644 --- a/packages/main/package.json +++ b/packages/main/package.json | |||
@@ -12,6 +12,7 @@ | |||
12 | "@sophie/shared": "workspace:*", | 12 | "@sophie/shared": "workspace:*", |
13 | "chalk": "^5.0.0", | 13 | "chalk": "^5.0.0", |
14 | "electron": "16.0.5", | 14 | "electron": "16.0.5", |
15 | "fs-extra": "^10.0.0", | ||
15 | "json5": "^2.2.0", | 16 | "json5": "^2.2.0", |
16 | "lodash-es": "^4.17.21", | 17 | "lodash-es": "^4.17.21", |
17 | "loglevel": "^1.8.0", | 18 | "loglevel": "^1.8.0", |
diff --git a/packages/main/src/index.ts b/packages/main/src/index.ts index 41424ab..ff14332 100644 --- a/packages/main/src/index.ts +++ b/packages/main/src/index.ts | |||
@@ -24,8 +24,7 @@ import { | |||
24 | BrowserWindow, | 24 | BrowserWindow, |
25 | ipcMain, | 25 | ipcMain, |
26 | } from 'electron'; | 26 | } from 'electron'; |
27 | import { readFileSync } from 'fs'; | 27 | import { ensureDirSync, readFile, readFileSync } from 'fs-extra'; |
28 | import { readFile } from 'fs/promises'; | ||
29 | import { autorun } from 'mobx'; | 28 | import { autorun } from 'mobx'; |
30 | import { getSnapshot, onPatch } from 'mobx-state-tree'; | 29 | import { getSnapshot, onPatch } from 'mobx-state-tree'; |
31 | import { join } from 'path'; | 30 | import { join } from 'path'; |
@@ -55,7 +54,9 @@ app.enableSandbox(); | |||
55 | 54 | ||
56 | // Use alternative directory when debugging to avoid clobbering the main installation. | 55 | // Use alternative directory when debugging to avoid clobbering the main installation. |
57 | if (isDevelopment) { | 56 | if (isDevelopment) { |
58 | app.setPath('userData', `${app.getPath('userData')}-dev`); | 57 | const devUserDataPath = `${app.getPath('userData')}-dev`; |
58 | app.setPath('userData', devUserDataPath); | ||
59 | ensureDirSync(devUserDataPath); | ||
59 | } | 60 | } |
60 | 61 | ||
61 | // Only allow a single instance at a time. | 62 | // Only allow a single instance at a time. |