Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
success() {
if (!scope.outputPath && scope.filename && scope.destDir) {
scope.outputPath = scope.destDir + scope.filename;
}
if (scope.generatorType !== 'new') {
logger.info(
'Generated a new ' +
scope.generatorType +
' `' +
scope.humanizeId +
'` at ' +
scope.humanizedPath +
'.'
); // eslint-disable-line prefer-template
}
process.exit(0);
},
});
rimraf(pluginPath, (err) => {
if (err) {
logger.error('An error occurred during plugin uninstallation.');
process.exit(1);
}
// Success.
logger.info('The plugin has been successfully uninstalled.');
process.exit(0);
});
};
success: function returnSuccess() {
if (!scope.outputPath && scope.filename && scope.destDir) {
scope.outputPath = scope.destDir + scope.filename;
}
if (scope.generatorType !== 'new') {
logger.info('Generated a new ' + scope.generatorType + ' `' + scope.humanizeId + '` at ' + scope.humanizedPath + '.'); // eslint-disable-line prefer-template
}
process.exit(0);
}
});
success: function returnSuccess() {
logger.info('Migration file successfully generated at `' + path.resolve(scope.rootPath, 'data', 'migrations', scope.connection) + '`.');
logger.info('Seed file created at `' + path.resolve(scope.rootPath, 'data', 'seeds', scope.connection) + '`.');
logger.warn('This migration has been automatically generated.');
logger.warn('We strongly advise you to manually verify those information.');
process.exit(0);
}
});
exec('npm install', function (err) {
if (err) {
logger.error('Impossible to install dependencies for `strapi-generate-' + name + '`.');
console.log(err);
} else {
logger.info('Successfully installed dependencies for `strapi-generate-' + name + '`.');
}
});
}
.then(() => {
logger.info('Migration successfully made for the `' + scope.connection + '` connection!');
process.exit(0);
});
};
success: function returnSuccess() {
if (!scope.outputPath && scope.filename && scope.destDir) {
scope.outputPath = scope.destDir + scope.filename;
}
if (scope.generatorType !== 'new') {
logger.info('Generated a new ' + scope.generatorType + ' `' + scope.humanizeId + '` at ' + scope.humanizedPath + '.');
}
process.exit(0);
}
});
.then(() => {
logger.info('Rollback successfully made for the `' + scope.connection + '` connection!');
process.exit(0);
});
};
redis.connect((err) => {
redis.disconnect();
if (err) {
logger.warn('Database connection has failed! Make sure your database is running.');
return error();
}
logger.info('The app has been connected to the database successfully!');
execSync(`rm -r "${scope.tmpPath}"`);
logger.info('Copying the dashboard...');
success();
});
};
redis.connect((err) => {
redis.disconnect();
if (err) {
logger.warn('Database connection has failed! Make sure your database is running.');
return error();
}
logger.info('The app has been connected to the database successfully!');
execSync(`rm -r "${scope.tmpPath}"`);
logger.info('Copying the dashboard...');
success();
});
};