From 7e876afb3bda456fea451fa77b92a61b00e2260d Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Wed, 16 Mar 2022 10:26:38 +0100 Subject: [PATCH] Update platform.service.ts --- tabby-electron/src/services/platform.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tabby-electron/src/services/platform.service.ts b/tabby-electron/src/services/platform.service.ts index ea308de0..2f49ebee 100644 --- a/tabby-electron/src/services/platform.service.ts +++ b/tabby-electron/src/services/platform.service.ts @@ -3,6 +3,7 @@ import * as fs from 'fs/promises' import * as gracefulFS from 'graceful-fs' import * as fsSync from 'fs' import * as os from 'os' +import { v4 as uuidv4 } from 'uuid' import { promisify } from 'util' import promiseIpc, { RendererProcessType } from 'electron-promise-ipc' import { execFile } from 'mz/child_process' @@ -119,7 +120,7 @@ export class ElectronPlatformService extends PlatformService { } async _saveConfigInternal (content: string): Promise { - const tempPath = this.configPath + '.new.' + Date.now().toString() + const tempPath = this.configPath + '.new.' + uuidv4().toString() await fs.writeFile(tempPath, content, 'utf8') await fs.writeFile(this.configPath + '.backup', content, 'utf8') await promisify(gracefulFS.rename)(tempPath, this.configPath)