Auto Create Configs

This commit is contained in:
bingus_violet 2024-06-07 22:21:02 -05:00
parent 6eccf928da
commit a4f687ac8c
3 changed files with 24 additions and 0 deletions

2
.gitignore vendored
View file

@ -130,3 +130,5 @@ dist
.yarn/install-state.gz
.pnp.*
# Simple Updater
config

7
defaults/config.json Normal file
View file

@ -0,0 +1,7 @@
{
"autoUpdates": [
{
}
]
}

15
index.js Normal file
View 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!")
}