From e865b399823174cc73ea480c661994a3ea3e736b Mon Sep 17 00:00:00 2001 From: Arcensoth Date: Fri, 23 Feb 2018 16:18:13 -0500 Subject: Allow config file to be passed as a parameter --- index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 9f22887..0d5aed4 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,13 @@ var Rcon = require("./lib/rcon.js"); var express = require("express"); var app = express(); var http = require("http").Server(app); -var c = require("./config.json"); + +var cfile = (process.argv.length > 2) ? process.argv[2] : "./config.json" + +console.log("[INFO] Using configuration file:", cfile); + +var c = require(cfile); + var debug = c.DEBUG; var shulker = new Discord.Client(); -- cgit 1.4.1