Skip to content

Commit

Permalink
Merge pull request #24 from jenkinsjby/development
Browse files Browse the repository at this point in the history
ImpactBuild fixGitDiffPath not working with some configuration
  • Loading branch information
dennis-behm authored Jun 23, 2020
2 parents be82dbf + 91a12f2 commit 50ec6b8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion utilities/ImpactUtilities.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,13 @@ def fixGitDiffPath(String file, String dir, boolean mustExist ) {
String dirName = new File(dir).getName()
if (new File("${dir}/${file}").exists())
return "$dirName/$file" as String


// Scenario: Directory ${dir} is not the root directory of the file
// Example :
// - applicationSrcDirs=nazare-demo-genapp/base/src/cobol,nazare-demo-genapp/base/src/bms
fixedFileName = buildUtils.relativizePath(dir) + ( file.indexOf ("/") >= 0 ? file.substring(file.lastIndexOf("/")) : file )
if ( new File("${props.workspace}/${fixedFileName}").exists())
return fixedFileName;
// returns null or assumed fullPath to file
return mustExist ? null : "${props.workspace}/${fixedFileName}"
}
Expand Down

0 comments on commit 50ec6b8

Please sign in to comment.