Auto Create Configs
This commit is contained in:
parent
6eccf928da
commit
a4f687ac8c
3 changed files with 24 additions and 0 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -130,3 +130,5 @@ dist
|
|||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
|
||||
# Simple Updater
|
||||
config
|
7
defaults/config.json
Normal file
7
defaults/config.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"autoUpdates": [
|
||||
{
|
||||
|
||||
}
|
||||
]
|
||||
}
|
15
index.js
Normal file
15
index.js
Normal file
|
@ -0,0 +1,15 @@
|
|||
const fs = require("fs"),
|
||||
path = require("path")
|
||||
|
||||
var configsPath = path.join(__dirname, "config")
|
||||
var confPath = path.join(configsPath, "config.json")
|
||||
|
||||
if (!fs.existsSync(configsPath)) {
|
||||
fs.mkdirSync(configsPath)
|
||||
}
|
||||
|
||||
if (!fs.existsSync(confPath)) {
|
||||
console.log("It would appear you have not created a config file yet! Generating one now.")
|
||||
fs.cpSync(path.join(__dirname, "defaults/config.json"), confPath)
|
||||
console.log("Done!")
|
||||
}
|
Loading…
Reference in a new issue