updated .gitignore
This commit is contained in:
parent
eba88a0476
commit
09e83d6117
5 changed files with 50 additions and 11 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -15,8 +15,7 @@ client_custom/src/pages
|
|||
devConfig/sequelizeCliConfig.js
|
||||
devConfig/testingConfig.js
|
||||
|
||||
config/mysqlConfig.json
|
||||
config/siteConfig.json
|
||||
config/
|
||||
|
||||
public/bundle/bundle.js
|
||||
public/bundle/bundle.js.map
|
||||
|
|
|
@ -12,6 +12,14 @@ let thumbnailChannelDefault = '@thumbnails';
|
|||
let thumbnailChannel = '';
|
||||
let thumbnailChannelId = '';
|
||||
|
||||
const createConfigFile = (fileName, configObject) => { // siteConfig.json , siteConfig
|
||||
const fileLocation = Path.resolve(__dirname, `../config/${fileName}`);
|
||||
const fileContents = JSON.stringify(configObject, null, 2);
|
||||
fs.writeFileSync(fileLocation, fileContents, 'utf-8');
|
||||
console.log(`Successfully created /config/${fileName}\n`);
|
||||
};
|
||||
|
||||
// import existing configs or import the defaults
|
||||
let mysqlConfig;
|
||||
try {
|
||||
mysqlConfig = require('../config/mysqlConfig.json');
|
||||
|
@ -37,14 +45,33 @@ const {
|
|||
},
|
||||
} = siteConfig;
|
||||
|
||||
let lbryConfig;
|
||||
try {
|
||||
lbryConfig = require('../config/lbryConfig.json');
|
||||
} catch (error) {
|
||||
lbryConfig = require('./defaults/lbryConfig.json');
|
||||
}
|
||||
|
||||
let loggerConfig;
|
||||
try {
|
||||
loggerConfig = require('../config/loggerConfig.json');
|
||||
} catch (error) {
|
||||
loggerConfig = require('./defaults/loggerConfig.json');
|
||||
}
|
||||
|
||||
let slackConfig;
|
||||
try {
|
||||
slackConfig = require('../config/slackConfig.json');
|
||||
} catch (error) {
|
||||
slackConfig = require('./defaults/slackConfig.json');
|
||||
}
|
||||
|
||||
// ask user questions and create config files
|
||||
inquirer
|
||||
.prompt(mysqlQuestions(mysqlDatabase, mysqlUsername, mysqlPassword))
|
||||
.then(results => {
|
||||
console.log('\nCreating mysql config file...');
|
||||
const fileLocation = Path.resolve(__dirname, '../config/mysqlConfig.json');
|
||||
const fileContents = JSON.stringify(results, null, 2);
|
||||
fs.writeFileSync(fileLocation, fileContents, 'utf-8');
|
||||
console.log('Successfully created /config/mysqlConfig.json!\n');
|
||||
createConfigFile('mysqlConfig.json', results);
|
||||
})
|
||||
.then(() => {
|
||||
// check for lbrynet connection & retrieve a default address
|
||||
|
@ -163,11 +190,11 @@ inquirer
|
|||
siteConfig['publishing']['uploadDirectory'] = results.uploadDirectory;
|
||||
})
|
||||
.then(() => {
|
||||
// create the siteConfig.json file
|
||||
const fileLocation = Path.resolve(__dirname, '../config/siteConfig.json');
|
||||
const fileContents = JSON.stringify(siteConfig, null, 2);
|
||||
fs.writeFileSync(fileLocation, fileContents, 'utf-8');
|
||||
console.log('Successfully created /config/siteConfig.json\n');
|
||||
// create the config files
|
||||
createConfigFile('siteConfig.json', siteConfig);
|
||||
createConfigFile('lbryConfig.json', lbryConfig);
|
||||
createConfigFile('loggerConfig.json', loggerConfig);
|
||||
createConfigFile('slackConfig.json', slackConfig);
|
||||
})
|
||||
.then(() => {
|
||||
console.log('\nYou\'re all done!');
|
||||
|
|
5
cli/defaults/lbryConfig.json
Normal file
5
cli/defaults/lbryConfig.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"apiHost": "localhost",
|
||||
"apiPort": "5279",
|
||||
"getTimeout": 30
|
||||
}
|
3
cli/defaults/loggerConfig.json
Normal file
3
cli/defaults/loggerConfig.json
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"logLevel": "verbose"
|
||||
}
|
5
cli/defaults/slackConfig.json
Normal file
5
cli/defaults/slackConfig.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"slackWebHook": false,
|
||||
"slackErrorChannel": false,
|
||||
"slackInfoChannel": false
|
||||
}
|
Loading…
Reference in a new issue