diff --git a/core/bbs.js b/core/bbs.js index 02058bce..43bf7cf3 100644 --- a/core/bbs.js +++ b/core/bbs.js @@ -29,11 +29,12 @@ const ENIGMA_COPYRIGHT = 'ENiGMA½ Copyright (c) 2014-2017 Bryan Ashby'; const HELP = `${ENIGMA_COPYRIGHT} usage: main.js +eg : main.js --config /enigma_install_path/config/ valid args: --version : display version --help : displays this help - --config PATH : override default config.hjson path + --config PATH : override default config path `; function printHelpAndExit() { @@ -56,7 +57,8 @@ function main() { return callback(null, configOverridePath || conf.getDefaultPath(), _.isString(configOverridePath)); }, function initConfig(configPath, configPathSupplied, callback) { - conf.init(resolvePath(configPath), function configInit(err) { + const configFile = configPath + 'config.hjson'; + conf.init(resolvePath(configFile), function configInit(err) { // // If the user supplied a path and we can't read/parse it @@ -65,7 +67,7 @@ function main() { if(err) { if('ENOENT' === err.code) { if(configPathSupplied) { - console.error('Configuration file does not exist: ' + configPath); + console.error('Configuration file does not exist: ' + configFile); } else { configPathSupplied = null; // make non-fatal; we'll go with defaults } diff --git a/core/config.js b/core/config.js index 506b5c28..a33efb99 100644 --- a/core/config.js +++ b/core/config.js @@ -111,8 +111,8 @@ function init(configPath, options, cb) { } function getDefaultPath() { - // e.g. /enigma-bbs-install-path/config/config.hjson - return './config/config.hjson'; + // e.g. /enigma-bbs-install-path/config/ + return './config/'; } function getDefaultConfig() { diff --git a/core/config_util.js b/core/config_util.js index 3ed7b98c..40723d9a 100644 --- a/core/config_util.js +++ b/core/config_util.js @@ -7,7 +7,7 @@ const paths = require('path'); exports.getFullConfig = getFullConfig; function getFullConfig(filePath, cb) { - // |filePath| is assumed to be in 'mods' if it's only a file name + // |filePath| is assumed to be in the config path if it's only a file name if('.' === paths.dirname(filePath)) { filePath = paths.join(Config.paths.config, filePath); } diff --git a/core/oputil/oputil_common.js b/core/oputil/oputil_common.js index 14edd518..e175a166 100644 --- a/core/oputil/oputil_common.js +++ b/core/oputil/oputil_common.js @@ -45,11 +45,12 @@ function printUsageAndSetExitCode(errMsg, exitCode) { } function getDefaultConfigPath() { - return './config/config.hjson'; + return './config/'; } function getConfigPath() { - return argv.config ? argv.config : config.getDefaultPath(); + const baseConfigPath = argv.config ? argv.config : config.getDefaultPath(); + return baseConfigPath + 'config.hjson'; } function initConfig(cb) {