mirror of
https://github.com/purocean/yn.git
synced 2026-09-24 15:46:02 +08:00
fix(main): fix startup crash when config.json is not exist
This commit is contained in:
+2
-2
@@ -1,10 +1,10 @@
|
||||
import * as fs from 'fs'
|
||||
import * as fs from 'fs-extra'
|
||||
import { CONFIG_FILE } from './constant'
|
||||
|
||||
const configFile = CONFIG_FILE
|
||||
|
||||
const writeJson = (data: any) => {
|
||||
fs.writeFileSync(configFile, JSON.stringify(data, null, 4), 'utf8')
|
||||
fs.writeJson(configFile, data, { spaces: 4 })
|
||||
}
|
||||
|
||||
const readJson = () => {
|
||||
|
||||
Reference in New Issue
Block a user