mirror of
https://github.com/Cameri/nostream.git
synced 2025-04-01 00:18:16 +02:00
chore: create settings file on startup
This commit is contained in:
parent
a581e90ad5
commit
4b8905b470
@ -1,4 +1,4 @@
|
||||
import { copyFileSync, readFileSync, unlinkSync, writeFileSync } from 'fs'
|
||||
import { copyFileSync, existsSync, readFileSync, unlinkSync, writeFileSync } from 'fs'
|
||||
import cluster from 'cluster'
|
||||
import { homedir } from 'os'
|
||||
import { join } from 'path'
|
||||
@ -67,6 +67,11 @@ const createSettings = (): ISettings => {
|
||||
if (_settings) {
|
||||
return _settings
|
||||
}
|
||||
|
||||
if (!existsSync(path)) {
|
||||
saveSettings(path, defaults)
|
||||
}
|
||||
|
||||
_settings = mergeDeepRight(defaults, loadSettings(path))
|
||||
|
||||
return _settings
|
||||
|
Loading…
x
Reference in New Issue
Block a user