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