Skip to content

Instantly share code, notes, and snippets.

@cybersonic
Last active December 13, 2016 10:25
Show Gist options
  • Select an option

  • Save cybersonic/8f44a857197220762aa037f955bcc240 to your computer and use it in GitHub Desktop.

Select an option

Save cybersonic/8f44a857197220762aa037f955bcc240 to your computer and use it in GitHub Desktop.
Used to compile files and track obvious syntax errors
<cfscript>
pathtoSourceCode = expandPath("/code");
files= DirectoryList(pathtoSourceCode, true);
passedFiles = [];
failedFiles = [];
failedErrors = {};
for(f in files){
if(ListLast(f, ".").startsWith("cf")){
if(fileExists(f)){
try{
getPageContext().compile(contractPath(f));
passedFiles.append(f);
}
catch(Any e){
failedErrors[f] = e;
failedFiles.append(f);
}
}
}
}
dump(var:passedFiles,label:"Compiled Files");
dump(var:failedFiles,label:"Failed Files");
dump(failedErrors);
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment