]> git.plutz.net Git - shellwiki/commitdiff
allow attachment revisioning
authorPaul Hänsch <paul@plutz.net>
Thu, 9 Jun 2022 13:24:25 +0000 (15:24 +0200)
committerPaul Hänsch <paul@plutz.net>
Thu, 9 Jun 2022 13:24:25 +0000 (15:24 +0200)
index.cgi

index 091254cf76795f1fdb0342edd47d59ebce923deb..db4d749b7c179efde9b4fec43a5158c5e4dd4d21 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -6,6 +6,7 @@
 . "${_EXEC}/tools.sh"
 . "${_EXEC}/acl.sh"
 
+REV_ATTACHMENTS=${REV_ATTACHMENTS:-false}
 WIKI_THEME="${WIKI_THEME:-default}"
 . "${_EXEC}/themes/${WIKI_THEME}.sh"
 
@@ -26,11 +27,11 @@ if [ "$(which git)" -a ! -f "$_DATA/.gitignore" ]; then
   cat >"$_DATA/.gitignore" <<-EOF
        users.db
        serverkey
-       */#attachments/
-       */#cache/
-       */#page.lock
-       */#page.*.cache
-       */#page.*.cache.*
+       $([ "$REV_ATTACHMENTS" = true ] || printf %s "**/#attachments/")
+       **/#cache/
+       **/#page.lock
+       **/#page.*.cache
+       **/#page.*.cache.*
        EOF
   git init "$_DATA"
   git -C "$_DATA" add .gitignore