summary refs log tree commit diff homepage
diff options
context:
space:
mode:
authorArcensoth <arcensoth@gmail.com>2018-02-23 16:18:13 -0500
committerArcensoth <arcensoth@gmail.com>2018-02-23 16:18:13 -0500
commite865b399823174cc73ea480c661994a3ea3e736b (patch)
tree6d303f1e0c7600fa742193e612ee2acd246088e7
parentIgnore node installation files (diff)
downloadshulker-e865b399823174cc73ea480c661994a3ea3e736b.tar.gz
shulker-e865b399823174cc73ea480c661994a3ea3e736b.zip
Allow config file to be passed as a parameter
-rw-r--r--index.js8
1 files changed, 7 insertions, 1 deletions
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();