Update base config logging, removal, and tests

This commit is contained in:
Evan Hahn 2022-01-11 13:12:55 -06:00 committed by GitHub
parent 5a3c9c7332
commit d9b951bfcb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 322 additions and 75 deletions

View file

@ -1,4 +1,4 @@
// Copyright 2017-2020 Signal Messenger, LLC
// Copyright 2017-2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { join } from 'path';
@ -34,7 +34,11 @@ console.log(`userData: ${app.getPath('userData')}`);
const userDataPath = app.getPath('userData');
const targetPath = join(userDataPath, 'config.json');
export const userConfig = start('user', targetPath);
export const userConfig = start({
name: 'user',
targetPath,
throwOnFilesystemErrors: true,
});
export const get = userConfig.get.bind(userConfig);
export const remove = userConfig.remove.bind(userConfig);