From c85a1b28bb960251cdcb4e8137fd40563d3f2421 Mon Sep 17 00:00:00 2001 From: tgpethan Date: Fri, 3 Jan 2020 04:03:04 +0000 Subject: [PATCH] Add checks for config and to also prevent the config from being packaged with the framework --- index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 53c807f..8986bf0 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,6 @@ const express = require("express"), fs = require("fs"), chalk = require("chalk"), -config = require("./config/config.json"), emoji = require("./misc/emoji_list.json"); class reqMod { constructor(name, status) { @@ -12,6 +11,14 @@ class reqMod { const requiredModules = [ new reqMod("handle_console", false) ]; +let config; +if (fs.existsSync("./config/config.json")) { + config = require("./config/config.json"); +} else { + console.log("[Config] Config file doesn't exist! You probably haven't copied the example config in the config directory."); + console.log("[Config] Exiting..."); + process.exit(1); +} global.actualDir = __dirname; global.internals = { version:"Open Source", -- 2.45.2