Skip to content

Commit

Permalink
Use absolute path for wrapper execution on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
DaGeRe committed Dec 8, 2022
1 parent 83968a3 commit f162917
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public String fetchMavenCall(File projectFolder) {
} else {
File potentialWrapper = new File(projectFolder, "mvnw.cmd");
if (potentialWrapper.exists()) {
return "mvnw.cmd";
return potentialWrapper.getAbsolutePath();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.io.File;

import org.hamcrest.MatcherAssert;
import org.hamcrest.Matchers;
import org.junit.Assert;
import org.junit.jupiter.api.Test;

Expand All @@ -20,7 +22,7 @@ public void testWrapper() {
if (EnvironmentVariables.isLinux()) {
Assert.assertEquals("./mvnw", mvnCall);
} else {
Assert.assertEquals("mvnw.cmd", mvnCall);
MatcherAssert.assertThat(mvnCall, Matchers.endsWith("mvnw.cmd"));
}
}

Expand Down

0 comments on commit f162917

Please sign in to comment.