Skip to content

Commit

Permalink
Use canonical path for template dir (#7388)
Browse files Browse the repository at this point in the history
  • Loading branch information
zippolyte authored Sep 14, 2020
1 parent 4e05912 commit 8dd3e56
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ public Builder withTemplateDir(String templateDir) {
// check to see if the folder exists
if (f.exists() && f.isDirectory()) {
uri = f.toURI();
this.templateDir = Paths.get(uri).toAbsolutePath().toString();
this.templateDir = Paths.get(uri).toAbsolutePath().normalize().toString();
} else {
URL url = this.getClass().getClassLoader().getResource(templateDir);
if (url != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void testDynamicSettingsWithBuilderSideEffects() throws Exception {
assertNotNull(workflowSettings);

assertEquals(generatorSettings.getGeneratorName(), "none");
assertEquals(workflowSettings.getTemplateDir(), current.getAbsolutePath());
assertEquals(workflowSettings.getTemplateDir(), current.getCanonicalPath());
assertNotEquals(workflowSettings.getTemplateDir(), input);

assertEquals(generatorSettings.getAdditionalProperties().size(), 4);
Expand Down

0 comments on commit 8dd3e56

Please sign in to comment.