@@ -35,6 +35,7 @@ import {
3535 sanitizePath ,
3636 selectedBoilerplate ,
3737 validateBoilerplate ,
38+ validateAppName ,
3839} from "../../util" ;
3940
4041export default class Create extends BaseCommand < typeof Create > {
@@ -61,7 +62,6 @@ export default class Create extends BaseCommand<typeof Create> {
6162 static flags : FlagInput = {
6263 name : flags . string ( {
6364 char : "n" ,
64- default : "app-boilerplate" ,
6565 description : appCreate . NAME_DESCRIPTION ,
6666 } ) ,
6767 "app-type" : flags . string ( {
@@ -152,13 +152,11 @@ export default class Create extends BaseCommand<typeof Create> {
152152 * @memberof Create
153153 */
154154 async flagsPromptQueue ( ) {
155- if ( isEmpty ( this . sharedConfig . appName ) ) {
156- this . sharedConfig . appName = await getAppName (
157- this . sharedConfig . defaultAppName
158- ) ;
155+ if ( this . sharedConfig . appName ) {
156+ validateAppName ( this . sharedConfig . appName ) ;
159157 }
160- let boilerplate : BoilerplateAppType | null = null ;
161158
159+ let boilerplate : BoilerplateAppType | null = null ;
162160 if ( isEmpty ( this . sharedConfig . boilerplateName ) ) {
163161 boilerplate = await selectedBoilerplate ( ) ;
164162 } else {
@@ -168,14 +166,17 @@ export default class Create extends BaseCommand<typeof Create> {
168166 }
169167
170168 if ( boilerplate ) {
171- const transformedName = boilerplate . name
172- . toLowerCase ( )
173- . replace ( / / g, "-" )
174- . substring ( 0 , 20 ) ;
169+ let boilerplateName = this . sharedConfig . appName || boilerplate . name ;
170+ if ( isEmpty ( this . sharedConfig . appName ) ) {
171+ boilerplateName = boilerplateName
172+ . toLowerCase ( )
173+ . replace ( / / g, "-" )
174+ . substring ( 0 , 20 ) ;
175+ }
175176
176- this . sharedConfig . boilerplateName = transformedName ;
177+ this . sharedConfig . boilerplateName = boilerplateName ;
177178 this . sharedConfig . appBoilerplateGithubUrl = boilerplate . link ;
178- this . sharedConfig . appName = transformedName ;
179+ this . sharedConfig . appName = boilerplateName ;
179180 }
180181
181182 //Auto select org in case of oauth
0 commit comments