Mega rejig!

This commit is contained in:
David Stephens
2017-11-22 23:27:33 +00:00
parent 617f0ef07e
commit 57d46dd57e
129 changed files with 153 additions and 154 deletions

View File

@@ -111,11 +111,8 @@ function init(configPath, options, cb) {
}
function getDefaultPath() {
const base = miscUtil.resolvePath('~/');
if(base) {
// e.g. /home/users/joeuser/.config/enigma-bbs/config.hjson
return paths.join(base, '.config', 'enigma-bbs', 'config.hjson');
}
// e.g. /enigma-bbs-install-path/config/config.hjson
return './config/config.hjson';
}
function getDefaultConfig() {
@@ -193,15 +190,17 @@ function getDefaultConfig() {
},
paths : {
mods : paths.join(__dirname, './../mods/'),
config : paths.join(__dirname, './../config/'),
mods : paths.join(__dirname, './../mods/system'),
userMods : paths.join(__dirname, './../mods/user'),
loginServers : paths.join(__dirname, './servers/login/'),
contentServers : paths.join(__dirname, './servers/content/'),
scannerTossers : paths.join(__dirname, './scanner_tossers/'),
mailers : paths.join(__dirname, './mailers/') ,
art : paths.join(__dirname, './../mods/art/'),
themes : paths.join(__dirname, './../mods/themes/'),
art : paths.join(__dirname, './../art/general/'),
themes : paths.join(__dirname, './../art/themes/'),
logs : paths.join(__dirname, './../logs/'), // :TODO: set up based on system, e.g. /var/logs/enigmabbs or such
db : paths.join(__dirname, './../db/'),
modsDb : paths.join(__dirname, './../db/mods/'),

View File

@@ -1,16 +1,15 @@
/* jslint node: true */
'use strict';
var configCache = require('./config_cache.js');
var paths = require('path');
const Config = require('./config.js').config;
const configCache = require('./config_cache.js');
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
if('.' === paths.dirname(filePath)) {
filePath = paths.join(__dirname, '../mods', filePath);
filePath = paths.join(Config.paths.config, filePath);
}
configCache.getConfig(filePath, function loaded(err, configJson) {

View File

@@ -102,6 +102,7 @@ function loadModulesForCategory(category, iterator, complete) {
function getModulePaths() {
return [
Config.paths.mods,
Config.paths.userMods,
Config.paths.loginServers,
Config.paths.contentServers,
Config.paths.scannerTossers,

View File

@@ -45,7 +45,7 @@ function printUsageAndSetExitCode(errMsg, exitCode) {
}
function getDefaultConfigPath() {
return resolvePath('~/.config/enigma-bbs/config.hjson');
return './config/config.hjson';
}
function getConfigPath() {