1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-23 05:03:36 +03:00

fixed profiles not getting saved on Windows - fixes #4330

This commit is contained in:
Eugene Pankov 2021-08-04 19:44:02 +02:00
parent 621005eb27
commit 28b84e38ca
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -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<void> {
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 {