From a4f687ac8ccae6fbb038e5d9a62e2e4fa2e0da1d Mon Sep 17 00:00:00 2001 From: bingus_violet Date: Fri, 7 Jun 2024 22:21:02 -0500 Subject: [PATCH] Auto Create Configs --- .gitignore | 2 ++ defaults/config.json | 7 +++++++ index.js | 15 +++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 defaults/config.json create mode 100644 index.js diff --git a/.gitignore b/.gitignore index ceaea36..c3b368c 100644 --- a/.gitignore +++ b/.gitignore @@ -130,3 +130,5 @@ dist .yarn/install-state.gz .pnp.* +# Simple Updater +config \ No newline at end of file diff --git a/defaults/config.json b/defaults/config.json new file mode 100644 index 0000000..519f4b7 --- /dev/null +++ b/defaults/config.json @@ -0,0 +1,7 @@ +{ + "autoUpdates": [ + { + + } + ] +} \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 0000000..238505e --- /dev/null +++ b/index.js @@ -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!") +} \ No newline at end of file