diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-07 14:58:58 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-04-07 14:58:58 +1000 |
| commit | 5d5bea575836c4427619e68fb535d45390154b49 (patch) | |
| tree | fcf150e02d2c304d4e82e0af8e9e76ace07d6c30 /src | |
| parent | bar: add optional labels for workspaces (diff) | |
| download | caelestia-shell-5d5bea575836c4427619e68fb535d45390154b49.tar.gz caelestia-shell-5d5bea575836c4427619e68fb535d45390154b49.tar.bz2 caelestia-shell-5d5bea575836c4427619e68fb535d45390154b49.zip | |
config: handle config deleted
Revert to defaults if config file moved/deleted
Diffstat (limited to 'src')
| -rw-r--r-- | src/config/funcs.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/config/funcs.ts b/src/config/funcs.ts index fbfb88e..77ee8dd 100644 --- a/src/config/funcs.ts +++ b/src/config/funcs.ts @@ -100,7 +100,9 @@ const updateSection = (from: { [k: string]: any }, to: { [k: string]: any }, pat }; export const updateConfig = async () => { - updateSection(deepMerge(defaults, JSON.parse(await readFileAsync(CONFIG))), config); + if (GLib.file_test(CONFIG, GLib.FileTest.EXISTS)) + updateSection(deepMerge(defaults, JSON.parse(await readFileAsync(CONFIG))), config); + else updateSection(defaults, config); await loadStyleAsync(); console.log("[LOG] Config updated"); }; |