From 6037ce31c7fb7c9ddc052fd29e90af0d285e1f27 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20B=C3=BCrk?= <stefan@buerk.tech>
Date: Sun, 22 May 2022 14:26:12 +0200
Subject: [PATCH] [TASK] Extend 'runTests.sh' to clean rendered documentation
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This change adds the ability to clean rendered documentation
folder and files in all system extension folders in one go.
Mentioned folders are `typo3/sysext/*/Documentation-GENERATED-temp`.

Added command/testsuite:

* `Build/Scripts/runTests.sh -s cleanRenderedDocumentation`

Additionally the already combined cleaning command `-s clean`
is extended to delete rendered documentation in the same run.

Resolves: #97673
Releases: main, 11.5, 10.4
Change-Id: I344f897769cd5f475d43db67dd1b27693f49a658
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74841
Tested-by: core-ci <typo3@b13.com>
Tested-by: Stefan Bürk <stefan@buerk.tech>
Reviewed-by: Stefan Bürk <stefan@buerk.tech>
---
 Build/Scripts/runTests.sh | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Build/Scripts/runTests.sh b/Build/Scripts/runTests.sh
index 1ccf65eb24c9..3bc6f2bdae21 100755
--- a/Build/Scripts/runTests.sh
+++ b/Build/Scripts/runTests.sh
@@ -114,6 +114,13 @@ cleanTestFiles() {
         echo "done"
 }
 
+cleanRenderedDocumentationFiles() {
+    # > caches
+    echo -n "Clean rendered documentation files ... " ; rm -rf \
+        ../../../typo3/sysext/*/Documentation-GENERATED-temp ; \
+        echo "done"
+}
+
 # Load help text into $HELP
 # @todo Remove xdebug / php8.2 note after PHP8.2 image contains working xdebug.
 read -r -d '' HELP <<EOF
@@ -151,6 +158,7 @@ Options:
             - clean: clean up build, cache and testing related files and folders
             - cleanBuild: clean up build related files and folders
             - cleanCache: clean up cache related files and folders
+            - cleanRenderedDocumentation: clean up rendered documentation files and folders (Documentation-GENERATED-temp)
             - cleanTests: clean up test related files and folders
             - composerInstall: "composer install"
             - composerInstallMax: "composer update", with no platform.php config.
@@ -657,6 +665,7 @@ case ${TEST_SUITE} in
     clean)
         cleanBuildFiles
         cleanCacheFiles
+        cleanRenderedDocumentationFiles
         cleanTestFiles
         ;;
     cleanBuild)
@@ -665,6 +674,9 @@ case ${TEST_SUITE} in
     cleanCache)
         cleanCacheFiles
         ;;
+    cleanRenderedDocumentation)
+        cleanRenderedDocumentationFiles
+        ;;
     cleanTests)
         cleanTestFiles
         ;;
-- 
GitLab