@@ -24,7 +24,8 @@ component extends="coldbox-cli.models.BaseCommand" {
2424 directory = " layouts" ,
2525 boolean open = false ,
2626 boolean force = false ,
27- content = " <h1>#arguments .name # Layout</h1>#variables .utility .BREAK #"
27+ content = " <h1>#arguments .name # Layout</h1>#variables .utility .BREAK #" ,
28+ boolean boxlang = isBoxLangProject ( getCWD () )
2829 ){
2930 // This will make each directory canonical and absolute
3031 arguments .directory = resolvePath ( arguments .directory );
@@ -37,15 +38,24 @@ component extends="coldbox-cli.models.BaseCommand" {
3738 // This help readability so the success messages aren't up against the previous command line
3839 print .line ();
3940
40- savecontent variable = " local.layoutContent" {
41- writeOutput ( " <cfoutput>#variables .utility .BREAK #" )
42- writeOutput ( arguments .content )
43- writeOutput ( " <div>## view()## </div>#variables .utility .BREAK #" )
44- writeOutput ( " </cfoutput>" )
45- };
41+ if ( arguments .boxlang ){
42+ savecontent variable = " local.layoutContent" {
43+ writeOutput ( " <bx:output>#variables .utility .BREAK #" )
44+ writeOutput ( arguments .content )
45+ writeOutput ( " <div>## view()## </div>#variables .utility .BREAK #" )
46+ writeOutput ( " </bx:output>" )
47+ };
48+ } else {
49+ savecontent variable = " local.layoutContent" {
50+ writeOutput ( " <cfoutput>#variables .utility .BREAK #" )
51+ writeOutput ( arguments .content )
52+ writeOutput ( " <div>## view()## </div>#variables .utility .BREAK #" )
53+ writeOutput ( " </cfoutput>" )
54+ };
55+ }
4656
4757 // Write out layout
48- var layoutPath = " #arguments .directory #/#arguments .name #.cfm" ;
58+ var layoutPath = " #arguments .directory #/#arguments .name #.# arguments . boxlang ? " bxm " : " cfm" # " ;
4959
5060 // Confirm it
5161 if (
@@ -67,7 +77,7 @@ component extends="coldbox-cli.models.BaseCommand" {
6777
6878 if ( arguments .helper ) {
6979 var layoutHelperContent = " <!--- #arguments .name # Layout Helper --->" ;
70- var layoutHelperPath = " #arguments .directory #/#arguments .name #Helper.cfm" ;
80+ var layoutHelperPath = " #arguments .directory #/#arguments .name #Helper.# arguments . boxlang ? " bxm " : " cfm" # " ;
7181 file action = " write" file = " #layoutHelperPath #" mode = " 777" output = " #layoutHelperContent #" ;
7282 printInfo ( " Created Layout Helper [#layoutHelperPath #]" );
7383
0 commit comments