Change wording

This commit is contained in:
Jim Laurie 2018-01-10 18:08:43 +01:00
parent b17d1a29b2
commit df5b9f3dab
4 changed files with 13 additions and 11 deletions

View File

@ -9,11 +9,13 @@ const logger = require('strapi-utils').logger;
module.exports = (scope, success, error) => { module.exports = (scope, success, error) => {
const knex = require(`${scope.rootPath}_/node_modules/knex`)({ const knex = require(`${scope.rootPath}_/node_modules/knex`)({
client: scope.client.module, client: scope.client.module,
connection: scope.database connection: Object.assign(scope.database, {
user: scope.database.username
})
}); });
knex.raw('select 1+1 as result').then(() => { knex.raw('select 1+1 as result').then(() => {
logger.info('Database connection is a success!'); logger.info('The app has been connected to the database successfully');
knex.destroy(); knex.destroy();
execSync(`rm -r ${scope.rootPath}_`); execSync(`rm -r ${scope.rootPath}_`);
@ -22,7 +24,7 @@ module.exports = (scope, success, error) => {
success(); success();
}) })
.catch(() => { .catch(() => {
logger.warn('Database connection failed!'); logger.warn('Database connection has failed! Make sure your database is running.');
error(); error();
}); });
}; };

View File

@ -53,7 +53,7 @@ module.exports = (scope, cb) => {
scope.database = {}; scope.database = {};
const connectionValidation = () => { const connectionValidation = () => {
const databaseChoises = [ const databaseChoices = [
{ {
name: 'MongoDB (highly recommended)', name: 'MongoDB (highly recommended)',
value: { value: {
@ -100,11 +100,11 @@ module.exports = (scope, cb) => {
type: 'list', type: 'list',
prefix: '', prefix: '',
name: 'client', name: 'client',
message: 'Choose your database:', message: 'Choose your main database:',
choices: databaseChoises, choices: databaseChoices,
default: () => { default: () => {
if (scope.client) { if (scope.client) {
return _.findIndex(databaseChoises, { value: _.omit(scope.client, ['version'])}); return _.findIndex(databaseChoices, { value: _.omit(scope.client, ['version'])});
} }
} }
} }

View File

@ -11,11 +11,11 @@ module.exports = (scope, success, error) => {
Mongoose.connect(`mongodb://${ (scope.database.username && scope.database.password) ? `${scope.database.username}:${scope.database.password}@` : '' }${scope.database.host}:${scope.database.port}/${scope.database.database}`, function (err) { Mongoose.connect(`mongodb://${ (scope.database.username && scope.database.password) ? `${scope.database.username}:${scope.database.password}@` : '' }${scope.database.host}:${scope.database.port}/${scope.database.database}`, function (err) {
if (err) { if (err) {
logger.warn('Database connection failed!'); logger.warn('Database connection has failed! Make sure your database is running.');
return error(); return error();
} }
logger.info('Database connection is a success!'); logger.info('The app has been connected to the database successfully!');
Mongoose.connection.close(); Mongoose.connection.close();

View File

@ -19,11 +19,11 @@ module.exports = (scope, success, error) => {
redis.disconnect(); redis.disconnect();
if (err) { if (err) {
logger.warn('Database connection failed!'); logger.warn('Database connection has failed! Make sure your database is running.');
return error(); return error();
} }
logger.info('Database connection is a success!'); logger.info('The app has been connected to the database successfully!');
execSync(`rm -r ${scope.rootPath}_`); execSync(`rm -r ${scope.rootPath}_`);