mirror of
https://github.com/Eugeny/tabby.git
synced 2024-12-23 10:32:29 +03:00
bumped js-yaml
This commit is contained in:
parent
e0efb4073a
commit
21084b5d24
@ -6,7 +6,7 @@ import { app } from 'electron'
|
|||||||
export function loadConfig (): any {
|
export function loadConfig (): any {
|
||||||
const configPath = path.join(app.getPath('userData'), 'config.yaml')
|
const configPath = path.join(app.getPath('userData'), 'config.yaml')
|
||||||
if (fs.existsSync(configPath)) {
|
if (fs.existsSync(configPath)) {
|
||||||
return yaml.safeLoad(fs.readFileSync(configPath, 'utf8'))
|
return yaml.load(fs.readFileSync(configPath, 'utf8'))
|
||||||
} else {
|
} else {
|
||||||
return {}
|
return {}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "terminus",
|
"name": "terminus",
|
||||||
"description": "A terminal for a modern age",
|
"description": "A terminal for a modern age",
|
||||||
|
"private": true,
|
||||||
"repository": "https://github.com/eugeny/terminus",
|
"repository": "https://github.com/eugeny/terminus",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Eugene Pankov",
|
"name": "Eugene Pankov",
|
||||||
@ -23,12 +24,12 @@
|
|||||||
"@ng-bootstrap/ng-bootstrap": "^6.1.0",
|
"@ng-bootstrap/ng-bootstrap": "^6.1.0",
|
||||||
"@terminus-term/node-pty": "0.10.0-beta10",
|
"@terminus-term/node-pty": "0.10.0-beta10",
|
||||||
"electron-config": "2.0.0",
|
"electron-config": "2.0.0",
|
||||||
"electron-debug": "^3.0.1",
|
"electron-debug": "^3.2.0",
|
||||||
"electron-is-dev": "1.1.0",
|
"electron-is-dev": "1.2.0",
|
||||||
"electron-promise-ipc": "^2.2.4",
|
"electron-promise-ipc": "^2.2.4",
|
||||||
"fontmanager-redux": "1.0.0",
|
"fontmanager-redux": "1.0.0",
|
||||||
"glasstron": "0.0.6",
|
"glasstron": "0.0.6",
|
||||||
"js-yaml": "3.14.0",
|
"js-yaml": "4.0.0",
|
||||||
"keytar": "^7.2.0",
|
"keytar": "^7.2.0",
|
||||||
"mz": "^2.7.0",
|
"mz": "^2.7.0",
|
||||||
"ngx-toastr": "^12.0.1",
|
"ngx-toastr": "^12.0.1",
|
||||||
|
@ -259,12 +259,10 @@ are-we-there-yet@~1.1.2:
|
|||||||
delegates "^1.0.0"
|
delegates "^1.0.0"
|
||||||
readable-stream "^2.0.6"
|
readable-stream "^2.0.6"
|
||||||
|
|
||||||
argparse@^1.0.7:
|
argparse@^2.0.1:
|
||||||
version "1.0.10"
|
version "2.0.1"
|
||||||
resolved "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz"
|
resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38"
|
||||||
integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
|
integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==
|
||||||
dependencies:
|
|
||||||
sprintf-js "~1.0.2"
|
|
||||||
|
|
||||||
asap@^2.0.0:
|
asap@^2.0.0:
|
||||||
version "2.0.6"
|
version "2.0.6"
|
||||||
@ -837,10 +835,10 @@ electron-config@2.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
conf "^1.0.0"
|
conf "^1.0.0"
|
||||||
|
|
||||||
electron-debug@^3.0.1:
|
electron-debug@^3.2.0:
|
||||||
version "3.1.0"
|
version "3.2.0"
|
||||||
resolved "https://registry.npmjs.org/electron-debug/-/electron-debug-3.1.0.tgz"
|
resolved "https://registry.yarnpkg.com/electron-debug/-/electron-debug-3.2.0.tgz#46a15b555c3b11872218c65ea01d058aa0814920"
|
||||||
integrity sha512-SWEqLj4MgfV3tGuO5eBLQ5/Nr6M+KPxsnE0bUJZvQebGJus6RAcdmvd7L+l0Ji31h2mmrN23l2tHFtCa2FvurA==
|
integrity sha512-7xZh+LfUvJ52M9rn6N+tPuDw6oRAjxUj9SoxAZfJ0hVCXhZCsdkrSt7TgXOiWiEOBgEV8qwUIO/ScxllsPS7ow==
|
||||||
dependencies:
|
dependencies:
|
||||||
electron-is-dev "^1.1.0"
|
electron-is-dev "^1.1.0"
|
||||||
electron-localshortcut "^3.1.0"
|
electron-localshortcut "^3.1.0"
|
||||||
@ -850,7 +848,12 @@ electron-is-accelerator@^0.1.0:
|
|||||||
resolved "https://registry.npmjs.org/electron-is-accelerator/-/electron-is-accelerator-0.1.2.tgz"
|
resolved "https://registry.npmjs.org/electron-is-accelerator/-/electron-is-accelerator-0.1.2.tgz"
|
||||||
integrity sha1-UJ5RDCala1Xhf4Y6SwThEYRqsns=
|
integrity sha1-UJ5RDCala1Xhf4Y6SwThEYRqsns=
|
||||||
|
|
||||||
electron-is-dev@1.1.0, electron-is-dev@^1.1.0:
|
electron-is-dev@1.2.0:
|
||||||
|
version "1.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/electron-is-dev/-/electron-is-dev-1.2.0.tgz#2e5cea0a1b3ccf1c86f577cee77363ef55deb05e"
|
||||||
|
integrity sha512-R1oD5gMBPS7PVU8gJwH6CtT0e6VSoD0+SzSnYpNm+dBkcijgA+K7VAMHDfnRq/lkKPZArpzplTW6jfiMYosdzw==
|
||||||
|
|
||||||
|
electron-is-dev@^1.1.0:
|
||||||
version "1.1.0"
|
version "1.1.0"
|
||||||
resolved "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-1.1.0.tgz"
|
resolved "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-1.1.0.tgz"
|
||||||
integrity sha512-Z1qA/1oHNowGtSBIcWk0pcLEqYT/j+13xUw/MYOrBUOL4X7VN0i0KCTf5SqyvMPmW5pSPKbo28wkxMxzZ20YnQ==
|
integrity sha512-Z1qA/1oHNowGtSBIcWk0pcLEqYT/j+13xUw/MYOrBUOL4X7VN0i0KCTf5SqyvMPmW5pSPKbo28wkxMxzZ20YnQ==
|
||||||
@ -972,11 +975,6 @@ escape-string-regexp@^1.0.5:
|
|||||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||||
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
||||||
|
|
||||||
esprima@^4.0.0:
|
|
||||||
version "4.0.1"
|
|
||||||
resolved "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz"
|
|
||||||
integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
|
|
||||||
|
|
||||||
execa@^0.7.0:
|
execa@^0.7.0:
|
||||||
version "0.7.0"
|
version "0.7.0"
|
||||||
resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777"
|
resolved "https://registry.yarnpkg.com/execa/-/execa-0.7.0.tgz#944becd34cc41ee32a63a9faf27ad5a65fc59777"
|
||||||
@ -1581,13 +1579,12 @@ isstream@~0.1.2:
|
|||||||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz"
|
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz"
|
||||||
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
|
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
|
||||||
|
|
||||||
js-yaml@3.14.0:
|
js-yaml@4.0.0:
|
||||||
version "3.14.0"
|
version "4.0.0"
|
||||||
resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz"
|
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.0.0.tgz#f426bc0ff4b4051926cd588c71113183409a121f"
|
||||||
integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==
|
integrity sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==
|
||||||
dependencies:
|
dependencies:
|
||||||
argparse "^1.0.7"
|
argparse "^2.0.1"
|
||||||
esprima "^4.0.0"
|
|
||||||
|
|
||||||
jsbn@~0.1.0:
|
jsbn@~0.1.0:
|
||||||
version "0.1.1"
|
version "0.1.1"
|
||||||
@ -3201,11 +3198,6 @@ split-on-first@^1.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f"
|
resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f"
|
||||||
integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==
|
integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw==
|
||||||
|
|
||||||
sprintf-js@~1.0.2:
|
|
||||||
version "1.0.3"
|
|
||||||
resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz"
|
|
||||||
integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
|
|
||||||
|
|
||||||
sshpk@^1.7.0:
|
sshpk@^1.7.0:
|
||||||
version "1.16.1"
|
version "1.16.1"
|
||||||
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz"
|
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz"
|
||||||
|
@ -75,7 +75,5 @@
|
|||||||
"lint": "eslint --ext ts */src */lib",
|
"lint": "eslint --ext ts */src */lib",
|
||||||
"postinstall": "node ./scripts/install-deps.js"
|
"postinstall": "node ./scripts/install-deps.js"
|
||||||
},
|
},
|
||||||
"repository": "eugeny/terminus",
|
"private": true
|
||||||
"author": "Eugene Pankov",
|
|
||||||
"license": "MIT"
|
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ export class ConfigService {
|
|||||||
|
|
||||||
load (): void {
|
load (): void {
|
||||||
if (fs.existsSync(this.path)) {
|
if (fs.existsSync(this.path)) {
|
||||||
this._store = yaml.safeLoad(fs.readFileSync(this.path, 'utf8'))
|
this._store = yaml.load(fs.readFileSync(this.path, 'utf8'))
|
||||||
} else {
|
} else {
|
||||||
this._store = {}
|
this._store = {}
|
||||||
}
|
}
|
||||||
@ -154,7 +154,7 @@ export class ConfigService {
|
|||||||
save (): void {
|
save (): void {
|
||||||
// Scrub undefined values
|
// Scrub undefined values
|
||||||
this._store = JSON.parse(JSON.stringify(this._store))
|
this._store = JSON.parse(JSON.stringify(this._store))
|
||||||
fs.writeFileSync(this.path, yaml.safeDump(this._store), 'utf8')
|
fs.writeFileSync(this.path, yaml.dump(this._store), 'utf8')
|
||||||
this.emitChange()
|
this.emitChange()
|
||||||
this.hostApp.broadcastConfigChange(JSON.parse(JSON.stringify(this.store)))
|
this.hostApp.broadcastConfigChange(JSON.parse(JSON.stringify(this.store)))
|
||||||
}
|
}
|
||||||
@ -163,14 +163,14 @@ export class ConfigService {
|
|||||||
* Reads config YAML as string
|
* Reads config YAML as string
|
||||||
*/
|
*/
|
||||||
readRaw (): string {
|
readRaw (): string {
|
||||||
return yaml.safeDump(this._store)
|
return yaml.dump(this._store)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Writes config YAML as string
|
* Writes config YAML as string
|
||||||
*/
|
*/
|
||||||
writeRaw (data: string): void {
|
writeRaw (data: string): void {
|
||||||
this._store = yaml.safeLoad(data)
|
this._store = yaml.load(data)
|
||||||
this.save()
|
this.save()
|
||||||
this.load()
|
this.load()
|
||||||
this.emitChange()
|
this.emitChange()
|
||||||
|
@ -60,7 +60,7 @@ export class SettingsTabComponent extends BaseTabComponent {
|
|||||||
this.settingsProviders = config.enabledServices(this.settingsProviders)
|
this.settingsProviders = config.enabledServices(this.settingsProviders)
|
||||||
this.themes = config.enabledServices(this.themes)
|
this.themes = config.enabledServices(this.themes)
|
||||||
|
|
||||||
this.configDefaults = yaml.safeDump(config.getDefaults())
|
this.configDefaults = yaml.dump(config.getDefaults())
|
||||||
|
|
||||||
const onConfigChange = () => {
|
const onConfigChange = () => {
|
||||||
this.configFile = config.readRaw()
|
this.configFile = config.readRaw()
|
||||||
@ -116,7 +116,7 @@ export class SettingsTabComponent extends BaseTabComponent {
|
|||||||
|
|
||||||
isConfigFileValid () {
|
isConfigFileValid () {
|
||||||
try {
|
try {
|
||||||
yaml.safeLoad(this.configFile)
|
yaml.load(this.configFile)
|
||||||
return true
|
return true
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
return false
|
return false
|
||||||
|
Loading…
Reference in New Issue
Block a user