summaryrefslogtreecommitdiffstats
path: root/helpcontent2/helpers/find-invalid-help-images.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
commit267c6f2ac71f92999e969232431ba04678e7437e (patch)
tree358c9467650e1d0a1d7227a21dac2e3d08b622b2 /helpcontent2/helpers/find-invalid-help-images.sh
parentInitial commit. (diff)
downloadlibreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz
libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'helpcontent2/helpers/find-invalid-help-images.sh')
-rwxr-xr-xhelpcontent2/helpers/find-invalid-help-images.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/helpcontent2/helpers/find-invalid-help-images.sh b/helpcontent2/helpers/find-invalid-help-images.sh
new file mode 100755
index 0000000000..d779f80b84
--- /dev/null
+++ b/helpcontent2/helpers/find-invalid-help-images.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# This script looks up <image ...> tags in helpcontent, checks whether the
+# referenced file exist in the colibre theme or in source/ and prints a warning if it does not.
+# Execute from the root directory of the helpcontent2 repository.
+# No parameters are used.
+
+images=$(git grep \<image source/);
+
+while read nextline ; do
+
+ # Source file is before the first :
+ sourcefile=${nextline%%:*};
+
+ # There is only one image tag per line, let's extract the src path
+ img2=${nextline#*src=\"};
+ img3=${img2%%\"*};
+
+ # Check the images existence
+ if [ ! -f "../icon-themes/colibre/$img3" ] ; then
+ # Not present in colibre, but it may be under source/
+ if [ ! -f "source/$img3" ] ; then
+ # Not even there, we have an error!
+ echo "$img3 included in file $sourcefile is not found in the colibre theme or the help media!";
+ fi
+ fi
+done <<< "$images"