You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2021/02/22 23:39:03 UTC

[isis] branch ISIS-2444 updated: ISIS-2444: generalizes logic to not remove files under /hooks/

This is an automated email from the ASF dual-hosted git repository.

danhaywood pushed a commit to branch ISIS-2444
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/ISIS-2444 by this push:
     new 5ee8eeb  ISIS-2444: generalizes logic to not remove files under /hooks/
5ee8eeb is described below

commit 5ee8eeb74c440891cdb20e00a42a725817d36f2a
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Mon Feb 22 23:38:48 2021 +0000

    ISIS-2444: generalizes logic to not remove files under /hooks/
---
 .../java/org/apache/isis/tooling/cli/projdoc/ProjectDocWriter.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tooling/cli/src/main/java/org/apache/isis/tooling/cli/projdoc/ProjectDocWriter.java b/tooling/cli/src/main/java/org/apache/isis/tooling/cli/projdoc/ProjectDocWriter.java
index b8cc9ea..ff957bf 100644
--- a/tooling/cli/src/main/java/org/apache/isis/tooling/cli/projdoc/ProjectDocWriter.java
+++ b/tooling/cli/src/main/java/org/apache/isis/tooling/cli/projdoc/ProjectDocWriter.java
@@ -76,9 +76,11 @@ final class ProjectDocWriter {
                 // delete all generated documents in the index
                 _Files.searchFiles(pagesFolder, dir->true, file-> {
                     val fileName = file.getName();
-                    final String parentFile = file.getParentFile().getName();
+                    val fileAbsolutePath = file.getAbsolutePath();
+                    final File parentFile = file.getParentFile();
+                    final String parentFileName = parentFile.getName();
                     return fileName.endsWith(".adoc") &&
-                           !parentFile.equals("hooks") &&
+                           !fileAbsolutePath.contains(File.separatorChar + "hooks" + File.separatorChar) &&
                            !fileName.equals(overview.getSystemOverviewFilename());
                 })
                 .stream()