Skip to content

Commit 9703bcd

Browse files
fix(create-app): improve prompt message (#3769)
1 parent d3e8bef commit 9703bcd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/create-app/__tests__/cli.spec.ts

+5
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ test('prompts for the framework if none supplied', () => {
4444
expect(stdout).toContain('Select a framework:')
4545
})
4646

47+
test('prompts for the framework on not supplying a value for --template', () => {
48+
const { stdout } = run([projectName, '--template'])
49+
expect(stdout).toContain('Select a framework:')
50+
})
51+
4752
test('prompts for the framework on supplying an invalid template', () => {
4853
const { stdout } = run([projectName, '--template', 'unknown'])
4954
expect(stdout).toContain(

packages/create-app/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ async function init() {
175175
type: template && TEMPLATES.includes(template) ? null : 'select',
176176
name: 'framework',
177177
message:
178-
template && !TEMPLATES.includes(template)
178+
typeof template === 'string' && !TEMPLATES.includes(template)
179179
? `"${template}" isn't a valid template. Please choose from below: `
180180
: 'Select a framework:',
181181
initial: 0,

0 commit comments

Comments
 (0)