mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-06 02:30:47 -08:00
fix: Error: ENOENT: no such file or directory, mkdir Roaming\\TidGi\\settings'
fixes #542
This commit is contained in:
parent
d89e030681
commit
f2231a3544
1 changed files with 3 additions and 0 deletions
|
|
@ -7,6 +7,9 @@ import fs from 'fs-extra';
|
|||
import { isWin } from '../../helpers/system';
|
||||
|
||||
export function fixEmptyAndErrorSettingFileOnStartUp() {
|
||||
if (!fs.existsSync(SETTINGS_FOLDER)) {
|
||||
fs.mkdirSync(SETTINGS_FOLDER, { recursive: true });
|
||||
}
|
||||
// Fix sometimes JSON is malformed https://github.com/nathanbuchar/electron-settings/issues/160
|
||||
if (fs.existsSync(settings.file())) {
|
||||
try {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue