8000 fix: send warning regarding invalid template to stderr (#2687) · webpack/webpack-cli@dc0481b · GitHub
[go: up one dir, main page]

Skip to content

Commit dc0481b

Browse files
fix: send warning regarding invalid template to stderr (#2687)
1 parent a8475f1 commit dc0481b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/generators/src/init-generator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export default class InitGenerator extends CustomGenerator {
5858
}
5959

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

6363
const { selectedTemplate } = await Question.List(
6464
this,

test/init/init.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ describe('init command', () => {
112112
const { stdout, stderr } = await runPromptWithAnswers(assetsPath, ['init', '--force', '--template=apple'], [`${ENTER}`]);
113113

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

118118
// Test files

0 commit comments

Comments
 (0)
0