mirror of
https://github.com/strapi/strapi.git
synced 2025-08-15 04:08:04 +00:00
Add error events during project generation
This commit is contained in:
parent
3c0d330e22
commit
4812f34bd5
@ -83,6 +83,7 @@ module.exports = (scope, cb) => {
|
|||||||
'cache-min': 999999999
|
'cache-min': 999999999
|
||||||
}, err => {
|
}, err => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
trackSuccess('didNotInstallProjectDependencies', scope);
|
||||||
console.log();
|
console.log();
|
||||||
console.log('⚠️ You should run `npm install` into your application before starting it.');
|
console.log('⚠️ You should run `npm install` into your application before starting it.');
|
||||||
console.log();
|
console.log();
|
||||||
@ -106,8 +107,10 @@ module.exports = (scope, cb) => {
|
|||||||
const data = shell.exec(`yarn --cwd ${scope.rootPath} add ${alphaDependencies} --production`, { silent: true });
|
const data = shell.exec(`yarn --cwd ${scope.rootPath} add ${alphaDependencies} --production`, { silent: true });
|
||||||
|
|
||||||
if (data.stderr && data.code !== 0) {
|
if (data.stderr && data.code !== 0) {
|
||||||
|
trackSuccess('didNotInstallProjectDependencies', scope);
|
||||||
cb();
|
cb();
|
||||||
}
|
}
|
||||||
|
|
||||||
pluginsInstallation();
|
pluginsInstallation();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -150,6 +153,7 @@ module.exports = (scope, cb) => {
|
|||||||
loader = ora(`Install plugin ${cyan(defaultPlugin.name)}.`).start();
|
loader = ora(`Install plugin ${cyan(defaultPlugin.name)}.`).start();
|
||||||
exec(`node ${strapiBin} install ${defaultPlugin.name} ${scope.developerMode && defaultPlugin.core ? '--dev' : ''}`, (err) => {
|
exec(`node ${strapiBin} install ${defaultPlugin.name} ${scope.developerMode && defaultPlugin.core ? '--dev' : ''}`, (err) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
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(err);
|
console.log(err);
|
||||||
return resolve();
|
return resolve();
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Node.js core.
|
// Node.js core.
|
||||||
|
const os = require('os');
|
||||||
const request = require('request');
|
const request = require('request');
|
||||||
const { machineIdSync } = require('node-machine-id');
|
const { machineIdSync } = require('node-machine-id');
|
||||||
|
|
||||||
@ -16,7 +17,8 @@ module.exports = function trackSuccess(event, scope, error) {
|
|||||||
uuid: scope.uuid,
|
uuid: scope.uuid,
|
||||||
deviceId: machineIdSync(),
|
deviceId: machineIdSync(),
|
||||||
properties: {
|
properties: {
|
||||||
error
|
error,
|
||||||
|
os: os.type()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.on('error', () => {});
|
.on('error', () => {});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user