Skip to content

Commit

Permalink
asconfigc: fix resolution of relative paths for extends and htmlTempl…
Browse files Browse the repository at this point in the history
…ate fields
  • Loading branch information
joshtynjala committed May 14, 2024
1 parent 106fa58 commit 516133c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions asconfigc/src/main/java/com/as3mxml/asconfigc/ASConfigC.java
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ private JsonNode loadConfigFromFileWithSchema(File configFile, JsonSchema schema
if (json.has(TopLevelFields.EXTENDS)) {
String otherConfigPath = json.get(TopLevelFields.EXTENDS).asText();
File otherConfigFile = new File(otherConfigPath);
if (!otherConfigFile.isAbsolute()) {
otherConfigFile = new File(System.getProperty("user.dir"), otherConfigPath);
}
JsonNode otherJson = loadConfigFromFileWithSchema(otherConfigFile, schema);
json = ConfigUtils.mergeConfigs(json, otherJson);
}
Expand Down Expand Up @@ -1090,6 +1093,9 @@ private void copyHTMLTemplate() throws ASConfigCException {
}

File templateDirectory = new File(htmlTemplate);
if (!templateDirectory.isAbsolute()) {
templateDirectory = new File(System.getProperty("user.dir"), htmlTemplate);
}
if (!templateDirectory.exists()) {
throw new ASConfigCException("htmlTemplate directory does not exist: " + htmlTemplate);
}
Expand Down

0 comments on commit 516133c

Please sign in to comment.