From 28b84e38ca7817a21b7a362cc84ca53baf6e71cc Mon Sep 17 00:00:00 2001 From: Eugene Pankov Date: Wed, 4 Aug 2021 19:44:02 +0200 Subject: [PATCH] fixed profiles not getting saved on Windows - fixes #4330 --- tabby-electron/src/services/platform.service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tabby-electron/src/services/platform.service.ts b/tabby-electron/src/services/platform.service.ts index a2cb4e7e..4ea0ecc3 100644 --- a/tabby-electron/src/services/platform.service.ts +++ b/tabby-electron/src/services/platform.service.ts @@ -1,7 +1,9 @@ import * as path from 'path' import * as fs from 'fs/promises' +import * as gracefulFS from 'graceful-fs' import * as fsSync from 'fs' import * as os from 'os' +import { promisify } from 'util' import promiseIpc, { RendererProcessType } from 'electron-promise-ipc' import { execFile } from 'mz/child_process' import { Injectable, NgZone } from '@angular/core' @@ -118,7 +120,7 @@ export class ElectronPlatformService extends PlatformService { async _saveConfigInternal (content: string): Promise { const tempPath = this.configPath + '.new' await fs.writeFile(tempPath, content, 'utf8') - await fs.rename(tempPath, this.configPath) + await promisify(gracefulFS.rename)(tempPath, this.configPath) } getConfigPath (): string|null {