Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/wincloud_gateway/node_modules/strapi/lib/commands/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 'use strict';
/**
* Module dependencies
*/
// Node.js core.
const path = require('path');
// Master of ceremonies for generators.
const generate = require('strapi-generate');
// Logger.
const { logger } = require('strapi-utils');
// Local Strapi dependencies.
const packageJSON = require('../../package.json');
/**
* `$ strapi generate`
*
* Scaffolding for the application in our working directory.
*/
module.exports = function(id, cliArguments) {
// Build initial scope.
const scope = {
rootPath: process.cwd(),
strapiRoot: path.resolve(__dirname, '..'),
id: id,
args: cliArguments,
strapiPackageJSON: packageJSON,
};
scope.generatorType = process.argv[2].split(':')[1];
// Show usage if no generator type is defined.
if (!scope.generatorType) {
return logger.error('Write `$ strapi generate:something` instead.');
}
return generate(scope, {
// Log and exit the REPL in case there is an error
// while we were trying to generate the requested generator.
error(msg) {
logger.error(msg);
process.exit(1);
},
// Log and exit the REPL in case of success
// but first make sure we have all the info we need.
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.name}\` at \`${scope.filePath}\`.`
);
}
process.exit(0);
},
});
};
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0176 ]-- |