Make files and folders
This commit is contained in:
parent
9ece56849d
commit
fe0e222417
1 changed files with 8 additions and 0 deletions
|
@ -12,6 +12,10 @@ var paths = {
|
|||
urls: path.join(__dirname, "data/urls.json")
|
||||
}
|
||||
|
||||
if (!fs.existsSync(paths.data)) {
|
||||
fs.mkdirSync(paths.data)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
paths,
|
||||
config: undefined,
|
||||
|
@ -47,6 +51,10 @@ module.exports = {
|
|||
}
|
||||
}
|
||||
|
||||
if (!fs.existsSync(paths.config)) {
|
||||
fs.writeFileSync(paths.config, "{}")
|
||||
}
|
||||
|
||||
var currentConfig = JSON.parse(fs.readFileSync(paths.config))
|
||||
var defaultConfig = JSON.parse(fs.readFileSync(paths.defaultConfig))
|
||||
currentConfig = Object.assign({}, defaultConfig, currentConfig)
|
||||
|
|
Loading…
Reference in a new issue