Update CLI configuration

This commit is contained in:
Shawn 2018-11-07 17:03:17 -05:00
parent 2e5b733059
commit 651d1cc9db

View file

@ -13,16 +13,16 @@ let thumbnailChannel = '';
let thumbnailChannelId = ''; let thumbnailChannelId = '';
const createConfigFile = (fileName, configObject) => { // siteConfig.json , siteConfig const createConfigFile = (fileName, configObject) => { // siteConfig.json , siteConfig
const fileLocation = Path.resolve(__dirname, `../config/${fileName}`); const fileLocation = Path.resolve(__dirname, `../site/config/${fileName}`);
const fileContents = JSON.stringify(configObject, null, 2); const fileContents = JSON.stringify(configObject, null, 2);
fs.writeFileSync(fileLocation, fileContents, 'utf-8'); fs.writeFileSync(fileLocation, fileContents, 'utf-8');
console.log(`Successfully created /config/${fileName}\n`); console.log(`Successfully created ./site/config/${fileName}\n`);
}; };
// import existing configs or import the defaults // import existing configs or import the defaults
let mysqlConfig; let mysqlConfig;
try { try {
mysqlConfig = require('../config/mysqlConfig.json'); mysqlConfig = require('../site/config/mysqlConfig.json');
} catch (error) { } catch (error) {
mysqlConfig = require('./defaults/mysqlConfig.json'); mysqlConfig = require('./defaults/mysqlConfig.json');
} }
@ -30,7 +30,7 @@ const { database: mysqlDatabase, username: mysqlUsername, password: mysqlPasswor
let siteConfig; let siteConfig;
try { try {
siteConfig = require('../config/siteConfig.json'); siteConfig = require('../site/config/siteConfig.json');
} catch (error) { } catch (error) {
siteConfig = require('./defaults/siteConfig.json'); siteConfig = require('./defaults/siteConfig.json');
} }
@ -48,21 +48,21 @@ const {
let lbryConfig; let lbryConfig;
try { try {
lbryConfig = require('../config/lbryConfig.json'); lbryConfig = require('../site/config/lbryConfig.json');
} catch (error) { } catch (error) {
lbryConfig = require('./defaults/lbryConfig.json'); lbryConfig = require('./defaults/lbryConfig.json');
} }
let loggerConfig; let loggerConfig;
try { try {
loggerConfig = require('../config/loggerConfig.json'); loggerConfig = require('../site/config/loggerConfig.json');
} catch (error) { } catch (error) {
loggerConfig = require('./defaults/loggerConfig.json'); loggerConfig = require('./defaults/loggerConfig.json');
} }
let slackConfig; let slackConfig;
try { try {
slackConfig = require('../config/slackConfig.json'); slackConfig = require('../site/config/slackConfig.json');
} catch (error) { } catch (error) {
slackConfig = require('./defaults/slackConfig.json'); slackConfig = require('./defaults/slackConfig.json');
} }