forked from loafle/openapi-generator-original
Use canonical path for template dir (#7388)
This commit is contained in:
@@ -442,7 +442,7 @@ public class WorkflowSettings {
|
||||
// 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) {
|
||||
|
||||
@@ -74,7 +74,7 @@ public class DynamicSettingsTest {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user