Skip to content
This repository was archived by the owner on Apr 28, 2026. It is now read-only.

Commit 555c8e5

Browse files
committed
update paths in H2 db creation
1 parent a85e327 commit 555c8e5

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

commands/wheels/generate/app.cfc

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ component aliases="wheels g app" extends="../base" {
9494
}
9595
}
9696

97+
print.greenBoldLine( 'Currently working in #getCWD()#');
98+
9799
// If the template is one of our "shortcut" names
98100
if ( variables.templateMap.keyExists( arguments.template ) ) {
99101
// Replace it with the actual ForgeBox slug name.
@@ -164,17 +166,18 @@ component aliases="wheels g app" extends="../base" {
164166
var datadirectory = fileSystemUtil.resolvePath( 'db/h2/' );
165167

166168
if ( !directoryExists( datadirectory ) ) {
167-
print.greenline( 'Creating /db/h2/ path...' ).toConsole();
169+
print.greenline( 'Creating #arguments.directory# path...' ).toConsole();
168170
directoryCreate( datadirectory );
169171
}
170172

171173
print.greenline( 'Adding Datasource to app.cfm...' ).toConsole();
172174
var datasourceConfig = 'this.datasources[''#arguments.datasourceName#''] = {
173175
class: ''org.h2.Driver''
174-
, connectionString: ''jdbc:h2:file:#expandPath( '/db/h2/' )##arguments.datasourceName#;MODE=MySQL''
175-
, username = ''sa''
176+
, connectionString: ''jdbc:h2:file:#datadirectory##arguments.datasourceName#;MODE=MySQL''
177+
, username = ''sa''
176178
};
177-
// CLI-Appends-Here';
179+
// CLI-Appends-Here';
180+
print.yellowline( datasourceConfig ).toConsole();
178181
command( 'tokenReplace' )
179182
.params( path = 'config/app.cfm', token = '// CLI-Appends-Here', replacement = datasourceConfig )
180183
.run();

0 commit comments

Comments
 (0)