Skip to content

Commit 33c806a

Browse files
committed
more updates
1 parent a9d0dc5 commit 33c806a

File tree

1 file changed

+26
-18
lines changed

1 file changed

+26
-18
lines changed

commands/coldbox/create/app.cfc

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/**
22
* Create a blank ColdBox app from one of our app skeletons or a skeleton using a valid Endpoint ID which can come from .
33
* FORGEBOX, HTTP/S, git, github, etc.
4-
* By default it will create the application in your current directory.
4+
* By default it will create a ColdBox BoxLang application in your current directory.
55
* .
66
* {code:bash}
77
* coldbox create app myApp
8+
* // Same as
9+
* coldbox create app MyApp --boxlang
810
* {code}
911
* .
1012
* Here are the basic skeletons that are available for you that come from FORGEBOX
@@ -19,6 +21,8 @@
1921
* .
2022
* {code:bash}
2123
* coldbox create app skeleton=modern
24+
* // Same as
25+
* coldbox create app --cfml
2226
* {code}
2327
* .
2428
* The skeleton parameter can also be any valid FORGEBOX Endpoint ID, which includes a Git repo or HTTP URL pointing to a package.
@@ -71,6 +75,7 @@ component extends="coldbox-cli.models.BaseCommand" {
7175
* @docker Include Docker files and setup Docker configuration
7276
* @vite Setup Vite for frontend asset building (For BoxLang or Modern apps only)
7377
* @rest Is this a REST API project? (For BoxLang apps only)
78+
* @cfml Set the language to CFML explicitly (overrides boxlang)
7479
**/
7580
function run(
7681
name = defaultAppName,
@@ -81,20 +86,31 @@ component extends="coldbox-cli.models.BaseCommand" {
8186
boolean initWizard = false,
8287
boolean verbose = false,
8388
boolean migrations = false,
84-
boolean boxlang = isBoxLangProject( getCWD() ),
89+
boolean boxlang = true,
8590
boolean docker = true,
8691
boolean vite = false,
87-
boolean rest = false
92+
boolean rest = false,
93+
boolean cfml = false
8894
){
8995
// Check for wizard argument
9096
if ( arguments.wizard ) {
9197
command( "coldbox create app-wizard" ).params( verbose = arguments.verbose ).run();
9298
return;
9399
}
94100

95-
job.start( "🧑‍🍳 Creating & Prepping Your App [#arguments.name#]" );
96-
if ( arguments.verbose ) {
97-
job.setDumpLog( arguments.verbose );
101+
// Start the job
102+
variables.print.boldGreenLine( "🧑‍🍳 Creating & Prepping Your App [#arguments.name#]" ).toConsole()
103+
104+
// Determine language via cfml or boxlang flags
105+
if ( arguments.cfml ) {
106+
arguments.boxlang = false;
107+
if( arguments.skeleton == variables.defaultSkeleton ){
108+
arguments.skeleton = "modern";
109+
}
110+
variables.print.line( "⚡Language set to CFML" ).toConsole()
111+
} else {
112+
arguments.boxlang = true;
113+
variables.print.line( "🥊 Language set to BoxLang" ).toConsole()
98114
}
99115

100116
// This will make the directory canonical and absolute
@@ -104,11 +120,6 @@ component extends="coldbox-cli.models.BaseCommand" {
104120
directoryCreate( arguments.directory );
105121
}
106122

107-
// If the skeleton = default and this is a boxlang project, then switch the skeleton to BoxLang
108-
if ( arguments.skeleton == "default" && arguments.boxlang ) {
109-
arguments.skeleton = variables.defaultSkeleton;
110-
}
111-
112123
// If the skeleton is one of our "shortcut" names
113124
if ( variables.templateMap.keyExists( arguments.skeleton ) ) {
114125
// Replace it with the actual ForgeBox slug name.
@@ -130,6 +141,7 @@ component extends="coldbox-cli.models.BaseCommand" {
130141
var originalPath = getCWD();
131142
// init must be run from CWD
132143
shell.cd( arguments.directory );
144+
variables.print.line( "🚀 Initializing ColdBox Application as a Box Package" ).toConsole();
133145
command( "init" )
134146
.params(
135147
name : arguments.name,
@@ -141,11 +153,10 @@ component extends="coldbox-cli.models.BaseCommand" {
141153
}
142154

143155
// Prepare language
156+
variables.print.line( "🤖 Setting up language specifics" ).toConsole();
144157
if ( arguments.boxlang ) {
145-
printInfo( "Setting language to BoxLang" );
146158
command( "package set" ).params( language: "BoxLang" ).run();
147159
} else {
148-
printInfo( "Setting language to CFML" );
149160
command( "package set" ).params( language: "CFML" ).run();
150161
}
151162

@@ -156,7 +167,7 @@ component extends="coldbox-cli.models.BaseCommand" {
156167
slug : variables.formatterUtil.slugify( arguments.name ),
157168
version : "1.0.0",
158169
location: "forgeboxStorage",
159-
ignore : []
170+
ignore : "[]"
160171
)
161172
.run();
162173

@@ -377,9 +388,6 @@ component extends="coldbox-cli.models.BaseCommand" {
377388
}
378389
}
379390

380-
// Finalize Create app Job
381-
job.complete();
382-
383391
variables.print
384392
.line( "🥊 Your ColdBox BoxLang application is ready to roll!" )
385393
.line( "👉 Run 'box server start' to launch the development server." )
@@ -396,4 +404,4 @@ component extends="coldbox-cli.models.BaseCommand" {
396404
return variables.templateMap.keyList().listToArray();
397405
}
398406

399-
}
407+
}

0 commit comments

Comments
 (0)