-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathModuleConfig.cfc
More file actions
30 lines (25 loc) · 873 Bytes
/
ModuleConfig.cfc
File metadata and controls
30 lines (25 loc) · 873 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
component {
this.dependencies = [ "cfmigrations", "sqlFormatter" ];
function configure() {
var sqlHighlighter = {
"highlight": ( str ) => ( {
"toAnsi": () => str
} )
};
try {
sqlHighlighter = createObject( "java", "org.jline.builtins.Nano$SyntaxHighlighter" ).build(
createObject( "java", "java.io.File" )
.init( expandPath( "/commandbox-migrations/lib/sql.nanorc" ) )
.toURI()
.toURL()
.toString()
);
} catch ( any e ) {
log.warn( "Could not create the jLine SyntaxHighlighter. Falling back to no highlighting", e );
}
binder
.map( "SqlHighlighter" )
.asSingleton()
.toValue( sqlHighlighter );
}
}