Merge branch 'development'
[KiwiIRC.git] / server / helpers / configloader.js
diff --git a/server/helpers/configloader.js b/server/helpers/configloader.js
new file mode 100644 (file)
index 0000000..7d673f7
--- /dev/null
@@ -0,0 +1,12 @@
+module.exports = function () {
+    var config = require('../configuration.js'),
+        conf_switch = process.argv.indexOf('-c');
+
+    if (conf_switch !== -1) {
+        if (process.argv[conf_switch + 1]) {
+            return config.loadConfig(process.argv[conf_switch + 1]);
+        }
+    }
+
+    return config.loadConfig();
+};