Skip to content

Commit

Permalink
Fixed issue where output does not write to the current working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
jsteinshouer committed Sep 30, 2018
1 parent 77199e1 commit 8319b64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.0.1

* Fixed issue where output does not write to the current working directory

## 2.0.0

* Running CFLint via the Java API instead of via the command line
Expand Down
9 changes: 5 additions & 4 deletions commands/cflint.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@ component{

// What cflint version we are using.
variables.CFLINT_VERSION = "1.4.0";
variables.REPORT_TEMPLATE = "/commandbox-cflint/resources/report.cfm" ;

/*
* Constructor
*/
function init(){
variables.workDirectory = fileSystemUtil.resolvePath( "." );
variables.rootPath = REReplaceNoCase( getDirectoryFromPath( getCurrentTemplatePath() ), "commands(\\|/)", "" );
variables.cflintJAR = rootPath & "lib/CFLint-#variables.CFLINT_VERSION#-all/CFLint-#variables.CFLINT_VERSION#-all.jar";
variables.reportTemplate = "/commandbox-cflint/resources/report.cfm" ;

return this;
}
Expand All @@ -54,6 +53,7 @@ component{
) {

var fullFilePaths = [];
var workDirectory = fileSystemUtil.resolvePath( "." );
// Split pattern for lists of globbing patterns
arguments.pattern
.listToArray()
Expand Down Expand Up @@ -105,7 +105,8 @@ component{
){
// Run the linter
var reportData = getReportData( arguments.files );
var outputFile = variables.workDirectory & "/" & arguments.fileName;
var workDirectory = fileSystemUtil.resolvePath( "." );
var outputFile = workDirectory & "/" & arguments.fileName;

// Run Display Procedures
displayReport( reportData );
Expand Down Expand Up @@ -230,7 +231,7 @@ component{
var content = "";

savecontent variable="content" {
include reportTemplate;
include REPORT_TEMPLATE;
}

if ( fileExists( arguments.outputFile ) ) {
Expand Down

0 comments on commit 8319b64

Please sign in to comment.