diff --git a/packages/cli/lib/artifact-generator.js b/packages/cli/lib/artifact-generator.js index 488d5abf370b..bd5ad38a5a84 100644 --- a/packages/cli/lib/artifact-generator.js +++ b/packages/cli/lib/artifact-generator.js @@ -79,14 +79,7 @@ module.exports = class ArtifactGenerator extends BaseGenerator { * >> Model MyModel will be created in src/models/my-model.model.ts **/ promptClassFileName(type, typePlural, name) { - this.log( - `${utils.toClassName(type)} ${chalk.yellow( - name, - )} will be created in src/${typePlural}/${chalk.yellow( - utils.toFileName(name) + '.' + `${type}.ts`, - )}`, - ); - this.log(); + utils.logClassCreation(type, typePlural, name, this.log.bind(this)); } scaffold() { diff --git a/packages/cli/lib/utils.js b/packages/cli/lib/utils.js index e8411b3a8a05..9cdf1403228f 100644 --- a/packages/cli/lib/utils.js +++ b/packages/cli/lib/utils.js @@ -119,6 +119,17 @@ exports.logNamingIssues = function(name, log) { } }; +exports.logClassCreation = function(type, typePlural, name, log) { + log( + `${exports.toClassName(type)} ${chalk.yellow( + name, + )} will be created in src/${typePlural}/${chalk.yellow( + exports.toFileName(name) + '.' + `${type}.ts`, + )}`, + ); + log(); +}; + /** * Validate project directory to not exist */