Skip to content

Commit

Permalink
fix: send warning regarding invalid template to stderr (#2687)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed May 5, 2021
1 parent a8475f1 commit dc0481b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/generators/src/init-generator.ts
Expand Up @@ -58,7 +58,7 @@ export default class InitGenerator extends CustomGenerator {
}

if (!this.supportedTemplates.includes(this.template)) {
this.utils.logger.log(`${yellow(`${this.template} is not a valid template, please select one from below`)}`);
this.utils.logger.warn(`${this.template} is not a valid template, please select one from below`);

const { selectedTemplate } = await Question.List(
this,
Expand Down
2 changes: 1 addition & 1 deletion test/init/init.test.js
Expand Up @@ -112,7 +112,7 @@ describe('init command', () => {
const { stdout, stderr } = await runPromptWithAnswers(assetsPath, ['init', '--force', '--template=apple'], [`${ENTER}`]);

expect(stdout).toContain('Project has been initialised with webpack!');
expect(stdout).toContain('apple is not a valid template, please select one from below');
expect(stderr).toContain('apple is not a valid template, please select one from below');
expect(stderr).toContain('webpack.config.js');

// Test files
Expand Down

0 comments on commit dc0481b

Please sign in to comment.