mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-30 00:09:54 +00:00
use atomically instead of write-file-atomic
This commit is contained in:
parent
ef49aa213e
commit
ce351117a5
@ -2,7 +2,7 @@ import * as fs from 'mz/fs'
|
||||
import * as path from 'path'
|
||||
import * as yaml from 'js-yaml'
|
||||
import { app } from 'electron'
|
||||
import writeFileAtomic from 'write-file-atomic'
|
||||
import { writeFile } from 'atomically'
|
||||
|
||||
|
||||
export function migrateConfig (): void {
|
||||
@ -30,6 +30,6 @@ export function loadConfig (): any {
|
||||
const configPath = path.join(app.getPath('userData'), 'config.yaml')
|
||||
|
||||
export async function saveConfig (content: string): Promise<void> {
|
||||
await writeFileAtomic(configPath, content, { encoding: 'utf8' })
|
||||
await writeFileAtomic(configPath + '.backup', content, { encoding: 'utf8' })
|
||||
await writeFile(configPath, content, { encoding: 'utf8' })
|
||||
await writeFile(configPath + '.backup', content, { encoding: 'utf8' })
|
||||
}
|
||||
|
@ -45,10 +45,9 @@
|
||||
"devDependencies": {
|
||||
"@types/mz": "2.7.4",
|
||||
"@types/node": "16.0.1",
|
||||
"@types/write-file-atomic": "^4.0.0",
|
||||
"atomically": "^1.7.0",
|
||||
"ngx-filesize": "^2.0.16",
|
||||
"patch-package": "^6.4.7",
|
||||
"write-file-atomic": "^4.0.1"
|
||||
"patch-package": "^6.4.7"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"tabby-community-color-schemes": "*",
|
||||
|
@ -150,13 +150,6 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.9.tgz#152c6c20a7688c30b967ec1841d31ace569863fc"
|
||||
integrity sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ==
|
||||
|
||||
"@types/write-file-atomic@^4.0.0":
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/write-file-atomic/-/write-file-atomic-4.0.0.tgz#ffcedcb1ae027e0a28ddfe218b72b3573797b5bc"
|
||||
integrity sha512-piEKt2KKBUtye+feTlfdPjtW7uPFsAaLNX3/f6AJD+Y1T1YPTFwnqtlO9Y+gy9qGshrvxKa/Kay9vqbyVIuhwQ==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@yarnpkg/lockfile@^1.1.0":
|
||||
version "1.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31"
|
||||
@ -317,6 +310,11 @@ asynckit@^0.4.0:
|
||||
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz"
|
||||
integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
|
||||
|
||||
atomically@^1.7.0:
|
||||
version "1.7.0"
|
||||
resolved "https://registry.yarnpkg.com/atomically/-/atomically-1.7.0.tgz#c07a0458432ea6dbc9a3506fffa424b48bccaafe"
|
||||
integrity sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w==
|
||||
|
||||
aws-sign2@~0.7.0:
|
||||
version "0.7.0"
|
||||
resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz"
|
||||
@ -3308,11 +3306,6 @@ signal-exit@^3.0.0, signal-exit@^3.0.2:
|
||||
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.3.tgz"
|
||||
integrity sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==
|
||||
|
||||
signal-exit@^3.0.7:
|
||||
version "3.0.7"
|
||||
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9"
|
||||
integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==
|
||||
|
||||
simple-concat@^1.0.0:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz"
|
||||
@ -3946,14 +3939,6 @@ write-file-atomic@^2.0.0, write-file-atomic@^2.3.0, write-file-atomic@^2.4.3:
|
||||
imurmurhash "^0.1.4"
|
||||
signal-exit "^3.0.2"
|
||||
|
||||
write-file-atomic@^4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.1.tgz#9faa33a964c1c85ff6f849b80b42a88c2c537c8f"
|
||||
integrity sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ==
|
||||
dependencies:
|
||||
imurmurhash "^0.1.4"
|
||||
signal-exit "^3.0.7"
|
||||
|
||||
x11@^2.3.0:
|
||||
version "2.3.0"
|
||||
resolved "https://registry.npmjs.org/x11/-/x11-2.3.0.tgz"
|
||||
|
Loading…
x
Reference in New Issue
Block a user