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/sequelizeCliConfig.js
|
||||||
devConfig/testingConfig.js
|
devConfig/testingConfig.js
|
||||||
|
|
||||||
config/mysqlConfig.json
|
config/
|
||||||
config/siteConfig.json
|
|
||||||
|
|
||||||
public/bundle/bundle.js
|
public/bundle/bundle.js
|
||||||
public/bundle/bundle.js.map
|
public/bundle/bundle.js.map
|
||||||
|
|
|
@ -12,6 +12,14 @@ let thumbnailChannelDefault = '@thumbnails';
|
||||||
let thumbnailChannel = '';
|
let thumbnailChannel = '';
|
||||||
let thumbnailChannelId = '';
|
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;
|
let mysqlConfig;
|
||||||
try {
|
try {
|
||||||
mysqlConfig = require('../config/mysqlConfig.json');
|
mysqlConfig = require('../config/mysqlConfig.json');
|
||||||
|
@ -37,14 +45,33 @@ const {
|
||||||
},
|
},
|
||||||
} = siteConfig;
|
} = 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
|
inquirer
|
||||||
.prompt(mysqlQuestions(mysqlDatabase, mysqlUsername, mysqlPassword))
|
.prompt(mysqlQuestions(mysqlDatabase, mysqlUsername, mysqlPassword))
|
||||||
.then(results => {
|
.then(results => {
|
||||||
console.log('\nCreating mysql config file...');
|
console.log('\nCreating mysql config file...');
|
||||||
const fileLocation = Path.resolve(__dirname, '../config/mysqlConfig.json');
|
createConfigFile('mysqlConfig.json', results);
|
||||||
const fileContents = JSON.stringify(results, null, 2);
|
|
||||||
fs.writeFileSync(fileLocation, fileContents, 'utf-8');
|
|
||||||
console.log('Successfully created /config/mysqlConfig.json!\n');
|
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// check for lbrynet connection & retrieve a default address
|
// check for lbrynet connection & retrieve a default address
|
||||||
|
@ -163,11 +190,11 @@ inquirer
|
||||||
siteConfig['publishing']['uploadDirectory'] = results.uploadDirectory;
|
siteConfig['publishing']['uploadDirectory'] = results.uploadDirectory;
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
// create the siteConfig.json file
|
// create the config files
|
||||||
const fileLocation = Path.resolve(__dirname, '../config/siteConfig.json');
|
createConfigFile('siteConfig.json', siteConfig);
|
||||||
const fileContents = JSON.stringify(siteConfig, null, 2);
|
createConfigFile('lbryConfig.json', lbryConfig);
|
||||||
fs.writeFileSync(fileLocation, fileContents, 'utf-8');
|
createConfigFile('loggerConfig.json', loggerConfig);
|
||||||
console.log('Successfully created /config/siteConfig.json\n');
|
createConfigFile('slackConfig.json', slackConfig);
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log('\nYou\'re all done!');
|
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