Bypass the entire connection process for SQLite and remove useless log

This commit is contained in:
Aurélien Georget 2019-02-14 14:03:53 +01:00
parent 2bf3165985
commit c5d88ace8b
2 changed files with 16 additions and 7 deletions

View File

@ -149,7 +149,7 @@ module.exports = (scope, cb) => {
if (code) { if (code) {
trackSuccess('didNotInstallProjectPlugins', scope); trackSuccess('didNotInstallProjectPlugins', scope);
loader.warn(`An error occurred during ${defaultPlugin.name} plugin installation.`); loader.warn(`An error occurred during ${defaultPlugin.name} plugin installation.`);
console.log(code, stdout, stderr); console.log(stderr);
return resolve(); return resolve();
} }

View File

@ -283,7 +283,7 @@ module.exports = (scope, cb) => {
} }
console.log(); console.log();
console.log('⏳ Testing database connection...'); console.log(isQuick ? '✅ Connected to the database' : '⏳ Testing database connection...');
resolve(); resolve();
}), }),
@ -309,6 +309,12 @@ module.exports = (scope, cb) => {
scope.additionalsDependencies = ['strapi-hook-knex', 'knex']; scope.additionalsDependencies = ['strapi-hook-knex', 'knex'];
} }
if (isQuick) {
scope.client.version = 'latest';
return resolve();
}
shell.exec(cmd, { silent: true }, () => { shell.exec(cmd, { silent: true }, () => {
if (scope.client.module) { if (scope.client.module) {
const lock = require(path.join(`${scope.tmpPath}`, '/node_modules/', `${scope.client.module}/package.json`)); const lock = require(path.join(`${scope.tmpPath}`, '/node_modules/', `${scope.client.module}/package.json`));
@ -328,7 +334,7 @@ module.exports = (scope, cb) => {
} }
if (scope.developerMode) { if (scope.developerMode) {
shell.exec(linkNodeModulesCommand, () => { shell.exec(linkNodeModulesCommand, { silent: true }, () => {
resolve(); resolve();
}); });
} else { } else {
@ -338,10 +344,13 @@ module.exports = (scope, cb) => {
}) })
]; ];
const connectedToTheDatabase = () => { const connectedToTheDatabase = (withMessage = true) => {
console.log();
console.log(`The app has been connected to the database ${green('successfully')}!`);
console.log(); console.log();
if (withMessage) {
console.log(`The app has been connected to the database ${green('successfully')}!`);
console.log();
}
trackSuccess('didConnectDatabase', scope); trackSuccess('didConnectDatabase', scope);
@ -352,7 +361,7 @@ module.exports = (scope, cb) => {
.then(() => { .then(() => {
// Bypass real connection test. // Bypass real connection test.
if (isQuick) { if (isQuick) {
return connectedToTheDatabase(); return connectedToTheDatabase(false);
} }
try { try {