Add error events during project generation

This commit is contained in:
Aurélien Georget 2019-02-08 18:13:40 +01:00
parent 3c0d330e22
commit 4812f34bd5
2 changed files with 7 additions and 1 deletions

View File

@ -83,6 +83,7 @@ module.exports = (scope, cb) => {
'cache-min': 999999999
}, err => {
if (err) {
trackSuccess('didNotInstallProjectDependencies', scope);
console.log();
console.log('⚠️ You should run `npm install` into your application before starting it.');
console.log();
@ -106,8 +107,10 @@ module.exports = (scope, cb) => {
const data = shell.exec(`yarn --cwd ${scope.rootPath} add ${alphaDependencies} --production`, { silent: true });
if (data.stderr && data.code !== 0) {
trackSuccess('didNotInstallProjectDependencies', scope);
cb();
}
pluginsInstallation();
}
} else {
@ -150,6 +153,7 @@ module.exports = (scope, cb) => {
loader = ora(`Install plugin ${cyan(defaultPlugin.name)}.`).start();
exec(`node ${strapiBin} install ${defaultPlugin.name} ${scope.developerMode && defaultPlugin.core ? '--dev' : ''}`, (err) => {
if (err) {
trackSuccess('didNotInstallProjectPlugins', scope);
loader.warn(`An error occurred during ${defaultPlugin.name} plugin installation.`);
console.log(err);
return resolve();

View File

@ -5,6 +5,7 @@
*/
// Node.js core.
const os = require('os');
const request = require('request');
const { machineIdSync } = require('node-machine-id');
@ -16,7 +17,8 @@ module.exports = function trackSuccess(event, scope, error) {
uuid: scope.uuid,
deviceId: machineIdSync(),
properties: {
error
error,
os: os.type()
}
})
.on('error', () => {});