Script to update web page Help files
authorColin Clark <colin.clark@cclark.uk>
Sat, 1 Jan 2022 11:27:17 +0000 (11:27 +0000)
committerColin Clark <colin.clark@cclark.uk>
Sat, 1 Jan 2022 11:27:17 +0000 (11:27 +0000)
CHECKLIST.md
scripts/web-help.sh [new file with mode: 0755]

index 149e3d7..ab7cb4c 100644 (file)
@@ -56,7 +56,13 @@ make update-po
 
 * Upload AppImage to web AppImages location
 * Edit `<location of local geeqie.github.io>/AppImage/appimages.txt` to include latest AppImage at the *top* of the list
-* Copy Help html files to `<location of local geeqie.github.io>/help`
+* Update the web-page Help files if they have changed
+    * commit and push if necessary
+
+```sh
+./scripts/web-help.sh
+```
+
 * Copy `geeqie.desktop` to `<location of local geeqie.github.io>/`
 * Copy `org.geeqie.Geeqie.appdata.xml` to `<location of local geeqie.github.io>/`
 * Push changes to `geeqie.github.io`
diff --git a/scripts/web-help.sh b/scripts/web-help.sh
new file mode 100755 (executable)
index 0000000..4a9fb1e
--- /dev/null
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+## @file
+## @brief Update the Geeqie webpage Help files
+##
+## It assumes that the main geeqie project folder and the
+## <em>geeqie.github.io</em> folder are at the same level.
+##
+## e.g.
+## @code
+##            /
+##            |
+##        somewhere
+##            |
+##     _______________
+##     |             |
+##   geeqie    geeqie.github.io
+## @endcode
+##
+## Files in <em>./doc/html</em> are regenerated and copied to the webpage folder.
+##
+## After the script has run, <em>git diff</em> will show any changes that
+## require a <em>git commit</em> and <em>git push</em> to be made.
+##
+
+if [ ! -d ".git" ] || [ ! -d "src" ] || [ ! -f "geeqie.1" ]
+then
+       echo "This is not a Geeqie project folder"
+       exit 1
+fi
+
+if [ ! -d "../geeqie.github.io/.git" ] || [ ! -d "../geeqie.github.io/help" ]
+then
+       echo "The Geeqie webpage project folder geeqie.github.io was not found"
+       exit 1
+fi
+
+rm -rf doc/html
+tmpdir=$(mktemp --tmpdir --directory)
+
+make -j install DESTDIR="$tmpdir"
+rm -r "$tmpdir"
+
+find ../geeqie.github.io/help/ -type f -exec rm "{}" \;
+cp -a doc/html/* ../geeqie.github.io/help
+
+exit 0