keep a backup of the config file

This commit is contained in:
Eugene Pankov 2021-09-02 22:40:01 +02:00
parent 8d0bcb94b1
commit d5c9e1e9f6
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -120,6 +120,7 @@ export class ElectronPlatformService extends PlatformService {
async _saveConfigInternal (content: string): Promise<void> {
const tempPath = this.configPath + '.new'
await fs.writeFile(tempPath, content, 'utf8')
await fs.writeFile(this.configPath + '.backup', content, 'utf8')
await promisify(gracefulFS.rename)(tempPath, this.configPath)
}