Skip to content

Commit aedbc25

Browse files
committed
Add force attribute to override none empty directory
1 parent 252c3fe commit aedbc25

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

commands/wheels/generate/app.cfc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ component aliases="wheels g app" extends="../base" {
6161
* @cfmlEngine The CFML engine to use for the app
6262
* @setupH2 Setup the H2 database for development
6363
* @init "init" the directory as a package if it isn't already
64+
* @force Force installation into an none empty directory
6465
**/
6566
function run(
6667
name = 'MyCFWheelsApp',
@@ -70,7 +71,8 @@ component aliases="wheels g app" extends="../base" {
7071
datasourceName,
7172
cfmlEngine = 'lucee',
7273
boolean setupH2 = false,
73-
boolean init = false
74+
boolean init = false,
75+
boolean force = false
7476
) {
7577
// set defaults based on app name
7678
if ( !len( arguments.directory ) ) {
@@ -88,8 +90,9 @@ component aliases="wheels g app" extends="../base" {
8890
print.greenBoldLine( 'Creating the target directory...' ).toConsole();
8991
directoryCreate( arguments.directory );
9092
} else {
91-
if ( arrayLen( directoryList( arguments.directory, false ) ) ) {
93+
if ( arrayLen( directoryList( arguments.directory, false ) ) && !force) {
9294
print.greenBoldLine( 'The target directory is not empty. The installation cannot continue.' ).toConsole();
95+
print.greenBoldLine( force ).toConsole();
9396
return;
9497
}
9598
}

0 commit comments

Comments
 (0)