Skip to content

Commit

Permalink
refactor(cli): use scoped debug statements in artifact-generator
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Delisle committed Jan 3, 2018
1 parent 036065b commit 8338302
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/cli/lib/artifact-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

'use strict';
const BaseGenerator = require('./base-generator');
const debug = require('./debug')('artifact-generator');
const utils = require('./utils');
const StatusConflicter = utils.StatusConflicter;

Expand All @@ -15,6 +16,7 @@ module.exports = class ArtifactGenerator extends BaseGenerator {
}

_setupGenerator() {
debug('Setting up generator');
this.argument('name', {
type: String,
required: false,
Expand All @@ -39,6 +41,7 @@ module.exports = class ArtifactGenerator extends BaseGenerator {
* 'keywords' is an array
*/
checkLoopBackProject() {
debug('Checking for loopback project');
if (this.shouldExit()) return false;
const pkg = this.fs.readJSON(this.destinationPath('package.json'));
const key = 'loopback';
Expand All @@ -64,6 +67,7 @@ module.exports = class ArtifactGenerator extends BaseGenerator {
}

promptArtifactName() {
debug('Prompting for artifact name');
if (this.shouldExit()) return false;
const prompts = [
{
Expand All @@ -82,6 +86,7 @@ module.exports = class ArtifactGenerator extends BaseGenerator {
}

scaffold() {
debug('Scaffolding artifact(s)');
if (this.shouldExit()) return false;
// Capitalize class name
this.artifactInfo.name = utils.toClassName(this.artifactInfo.name);
Expand Down

0 comments on commit 8338302

Please sign in to comment.