forked from lucee/lucee-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.cfm
30 lines (28 loc) · 955 Bytes
/
build.cfm
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
<cfprocessingdirective suppressWhitespace="true" />
<cfsetting requesttimeout="1200" />
<cfscript>
function exitCode( required numeric code ) {
var exitcodeFile = GetDirectoryFromPath( GetCurrentTemplatePath() ) & "/.exitcode";
FileWrite( exitcodeFile, code );
}
try {
savecontent variable="suppressingwhitespacehere" {
new api.build.BuildRunner().buildAll();
}
} catch ( any e ) {
exitCode( 1 );
newline = Chr( 10 );
echo( "" & newline );
echo( "Documentation build error" & newline );
echo( "-------------------------" & newline );
echo( "" & newline );
echo( "[#e.type#] error occurred while building the docs. Message: [#e.message#]. Detail: [#e.detail#]." & newline );
if ( ( e.tagContext ?: [] ).len() ) {
echo( "" & newline );
echo( "Stacktrace:" & newline );
for( var tracePoint in e.tagContext ) {
echo( " " & tracepoint.template & " (line #tracepoint.line#)" & newline );
}
}
}
</cfscript>