@@ -53,7 +53,9 @@ export default class Create extends BaseCommand<typeof Create> {
5353 "$ <%= config.bin %> <%= command.id %> --name App-1 --app-type stack" ,
5454 "$ <%= config.bin %> <%= command.id %> --name App-2 --app-type stack -d ./boilerplate" ,
5555 "$ <%= 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>" ,
5759 ] ;
5860
5961 static flags : FlagInput = {
@@ -75,7 +77,7 @@ export default class Create extends BaseCommand<typeof Create> {
7577 char : "d" ,
7678 description : commonMsg . CURRENT_WORKING_DIR ,
7779 } ) ,
78- " boilerplate" : flags . string ( {
80+ boilerplate : flags . string ( {
7981 description : appCreate . BOILERPLATE_TEMPLATES ,
8082 } ) ,
8183 } ;
@@ -155,22 +157,26 @@ export default class Create extends BaseCommand<typeof Create> {
155157 this . sharedConfig . defaultAppName
156158 ) ;
157159 }
160+ let boilerplate : BoilerplateAppType | null = null ;
161+
158162 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 ( ) ;
170164 } 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 ;
172179 }
173- this . sharedConfig . appName = this . sharedConfig . boilerplateName ;
174180
175181 //Auto select org in case of oauth
176182 this . sharedConfig . org =
0 commit comments