@@ -53,7 +53,9 @@ export default class Create extends BaseCommand<typeof Create> {
53
53
"$ <%= config.bin %> <%= command.id %> --name App-1 --app-type stack" ,
54
54
"$ <%= config.bin %> <%= command.id %> --name App-2 --app-type stack -d ./boilerplate" ,
55
55
"$ <%= config.bin %> <%= command.id %> --name App-3 --app-type organization --org <UID> -d ./boilerplate -c ./external-config.json" ,
56
- "$ <%= config.bin %> <%= command.id %> --name App-4 --app-type organization --org <UID> --boilerplates <boilerplate-name>" ,
56
+ "$ <%= config.bin %> <%= command.id %> --name App-4 --app-type organization --org <UID> --boilerplate <App Boilerplate>" ,
57
+ "$ <%= config.bin %> <%= command.id %> --name App-4 --app-type organization --org <UID> --boilerplate <DAM App Boilerplate>" ,
58
+ "$ <%= config.bin %> <%= command.id %> --name App-4 --app-type organization --org <UID> --boilerplate <Ecommerce App Boilerplate>" ,
57
59
] ;
58
60
59
61
static flags : FlagInput = {
@@ -75,7 +77,7 @@ export default class Create extends BaseCommand<typeof Create> {
75
77
char : "d" ,
76
78
description : commonMsg . CURRENT_WORKING_DIR ,
77
79
} ) ,
78
- " boilerplate" : flags . string ( {
80
+ boilerplate : flags . string ( {
79
81
description : appCreate . BOILERPLATE_TEMPLATES ,
80
82
} ) ,
81
83
} ;
@@ -155,22 +157,26 @@ export default class Create extends BaseCommand<typeof Create> {
155
157
this . sharedConfig . defaultAppName
156
158
) ;
157
159
}
160
+ let boilerplate : BoilerplateAppType | null = null ;
161
+
158
162
if ( isEmpty ( this . sharedConfig . boilerplateName ) ) {
159
- const boilerplate : BoilerplateAppType = await selectedBoilerplate ( ) ;
160
-
161
- if ( boilerplate ) {
162
- this . sharedConfig . boilerplateName = boilerplate . name
163
- . toLowerCase ( )
164
- . replace ( / / g, "-" ) ;
165
- this . sharedConfig . appBoilerplateGithubUrl = boilerplate . link ;
166
- this . sharedConfig . appName = await getAppName (
167
- this . sharedConfig . boilerplateName
168
- ) ;
169
- }
163
+ boilerplate = await selectedBoilerplate ( ) ;
170
164
} else {
171
- await validateBoilerplate ( this . sharedConfig . boilerplateName ) ;
165
+ boilerplate = ( await validateBoilerplate (
166
+ this . sharedConfig . boilerplateName
167
+ ) ) as BoilerplateAppType ;
168
+ }
169
+
170
+ if ( boilerplate ) {
171
+ const transformedName = boilerplate . name
172
+ . toLowerCase ( )
173
+ . replace ( / / g, "-" )
174
+ . substring ( 0 , 20 ) ;
175
+
176
+ this . sharedConfig . boilerplateName = transformedName ;
177
+ this . sharedConfig . appBoilerplateGithubUrl = boilerplate . link ;
178
+ this . sharedConfig . appName = transformedName ;
172
179
}
173
- this . sharedConfig . appName = this . sharedConfig . boilerplateName ;
174
180
175
181
//Auto select org in case of oauth
176
182
this . sharedConfig . org =
0 commit comments