Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
Fixes #364.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrowndotje committed Nov 7, 2023
1 parent 682129a commit a971416
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ targetCompatibility = 17

description = 'Structurizr DSL'
group = 'com.structurizr'
version = '1.33.0'
version = '1.33.1'

test {
useJUnitPlatform()
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.33.1 (unreleased)

- Fixes https://github.com/structurizr/dsl/issues/364 (.DS_Store file causes exception during !include <directory> on Windows)

## 1.33.0 (27th October 2023)

- DSL identifiers (if present) will now be loaded when extending a JSON workspace (see https://github.com/structurizr/dsl/discussions/328).
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/com/structurizr/dsl/IncludeParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ void parse(IncludedDslContext context, Tokens tokens) {

readFiles(context, path);
} catch (IOException e) {
throw new RuntimeException(e.getMessage());
throw new RuntimeException("Error including " + path.getAbsolutePath() + ": " + e.getMessage());
}
}
}
}

private void readFiles(IncludedDslContext context, File path) throws IOException {
if (path.isHidden()) {
if (path.isHidden() || path.getName().startsWith(".")) {
// ignore
return;
}
Expand All @@ -62,7 +62,11 @@ private void readFiles(IncludedDslContext context, File path) throws IOException
}
}
} else {
context.addFile(path, Files.readAllLines(path.toPath(), StandardCharsets.UTF_8));
try {
context.addFile(path, Files.readAllLines(path.toPath(), StandardCharsets.UTF_8));
} catch (IOException e) {
throw new RuntimeException("Error reading file at " + path.getAbsolutePath() + ": " + e.getMessage());
}
}
}

Expand Down

0 comments on commit a971416

Please sign in to comment.