Add checks for config and to also prevent the config from being packaged with the framework

This commit is contained in:
tgpethan 2020-01-03 04:03:04 +00:00
parent 4466f5aa18
commit c85a1b28bb
1 changed files with 8 additions and 1 deletions

View File

@ -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",