Skip to content

Commit

Permalink
Fix Windows bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrik Erdes committed Feb 18, 2019
1 parent 6952608 commit 9f8a34f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/groovy/se/patrikerdes/UseLatestVersionsTask.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ class UseLatestVersionsTask extends DefaultTask {
}

String variableDefinitionMatchStringForFileName(String variable, String fileName) {
if (fileName.split(File.separator).last() == 'gradle.properties') {
String splitter = File.separator.replace('\\', '\\\\')
if (fileName.split(splitter).last() == 'gradle.properties') {
return gradlePropertiesVariableDefinitionMatchString(variable)
}
variableDefinitionMatchString(variable)
Expand Down

1 comment on commit 9f8a34f

@patrikerdes
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The windows separator \ needs to be escaped in a regexp.

Please sign in to comment.