From 8319b64e4d0a185624ae688bd9177fd7966717d7 Mon Sep 17 00:00:00 2001 From: Jason Steinshouer Date: Sun, 30 Sep 2018 07:31:00 -0500 Subject: [PATCH] Fixed issue where output does not write to the current working directory --- CHANGELOG.md | 4 ++++ commands/cflint.cfc | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 18cdc2d..56ba9c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/commands/cflint.cfc b/commands/cflint.cfc index d466803..d56c25d 100644 --- a/commands/cflint.cfc +++ b/commands/cflint.cfc @@ -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; } @@ -54,6 +53,7 @@ component{ ) { var fullFilePaths = []; + var workDirectory = fileSystemUtil.resolvePath( "." ); // Split pattern for lists of globbing patterns arguments.pattern .listToArray() @@ -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 ); @@ -230,7 +231,7 @@ component{ var content = ""; savecontent variable="content" { - include reportTemplate; + include REPORT_TEMPLATE; } if ( fileExists( arguments.outputFile ) ) {