@@ -35,6 +35,7 @@ import {
35
35
sanitizePath ,
36
36
selectedBoilerplate ,
37
37
validateBoilerplate ,
38
+ validateAppName ,
38
39
} from "../../util" ;
39
40
40
41
export default class Create extends BaseCommand < typeof Create > {
@@ -61,7 +62,6 @@ export default class Create extends BaseCommand<typeof Create> {
61
62
static flags : FlagInput = {
62
63
name : flags . string ( {
63
64
char : "n" ,
64
- default : "app-boilerplate" ,
65
65
description : appCreate . NAME_DESCRIPTION ,
66
66
} ) ,
67
67
"app-type" : flags . string ( {
@@ -152,13 +152,11 @@ export default class Create extends BaseCommand<typeof Create> {
152
152
* @memberof Create
153
153
*/
154
154
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 ) ;
159
157
}
160
- let boilerplate : BoilerplateAppType | null = null ;
161
158
159
+ let boilerplate : BoilerplateAppType | null = null ;
162
160
if ( isEmpty ( this . sharedConfig . boilerplateName ) ) {
163
161
boilerplate = await selectedBoilerplate ( ) ;
164
162
} else {
@@ -168,14 +166,17 @@ export default class Create extends BaseCommand<typeof Create> {
168
166
}
169
167
170
168
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
+ }
175
176
176
- this . sharedConfig . boilerplateName = transformedName ;
177
+ this . sharedConfig . boilerplateName = boilerplateName ;
177
178
this . sharedConfig . appBoilerplateGithubUrl = boilerplate . link ;
178
- this . sharedConfig . appName = transformedName ;
179
+ this . sharedConfig . appName = boilerplateName ;
179
180
}
180
181
181
182
//Auto select org in case of oauth
0 commit comments