Mega rejig!
This commit is contained in:
@@ -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/'),
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -45,7 +45,7 @@ function printUsageAndSetExitCode(errMsg, exitCode) {
|
||||
}
|
||||
|
||||
function getDefaultConfigPath() {
|
||||
return resolvePath('~/.config/enigma-bbs/config.hjson');
|
||||
return './config/config.hjson';
|
||||
}
|
||||
|
||||
function getConfigPath() {
|
||||
|
||||
Reference in New Issue
Block a user