Skip to content

Commit 95c9281

Browse files
committed
Keep asking user to set a name of component
1 parent 85a6735 commit 95c9281

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

codegen.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ const main = async () => {
2727
* v: when true, view will be generated; default to true
2828
* V: when true, view will not be genereated
2929
*/
30-
let { name = 'comp', v = true, V } = getArgs();
30+
let { name, v = true, V } = getArgs();
3131

32-
// Make sure user gives name
33-
if (name === 'comp') {
32+
// Make sure name has a value
33+
while (!name) {
34+
console.log('Component name is NOT found!');
3435
name = await askQuestion('Name of the Component?');
3536
}
3637

0 commit comments

Comments
 (0)