Skip to content

Commit

Permalink
fix: check if bpmn directory exists for dev mode. (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejpetras authored Nov 1, 2023
1 parent 5527fb0 commit 58cfa19
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ void watchChanges(ZeebeBuildTimeConfig config, ZeebeResourcesBuildItem resources
try {
Enumeration<URL> location = Thread.currentThread().getContextClassLoader()
.getResources(config.resources.location);
Files.walk(Path.of(location.nextElement().toURI()))
.filter(Files::isDirectory)
.map(Path::toString)
.map(dir -> dir.replace('\\', '/'))
.peek(dir -> log.infof("Watched bpmn sub-directory %s", dir))
.forEach(dir -> watchedPaths.produce(new HotDeploymentWatchedFileBuildItem(dir)));
if (location.hasMoreElements()) {
Files.walk(Path.of(location.nextElement().toURI()))
.filter(Files::isDirectory)
.map(Path::toString)
.map(dir -> dir.replace('\\', '/'))
.peek(dir -> log.infof("Watched bpmn sub-directory %s", dir))
.forEach(dir -> watchedPaths.produce(new HotDeploymentWatchedFileBuildItem(dir)));
}
} catch (Exception ex) {
throw new RuntimeException("Error find all sub-directories of " + config.resources.location, ex);
}
Expand Down

0 comments on commit 58cfa19

Please sign in to comment.