]> git.plutz.net Git - shellwiki/commitdiff
fallback cd when printing revisions of deleted pages
authorPaul Hänsch <paul@plutz.net>
Wed, 25 May 2022 21:03:41 +0000 (23:03 +0200)
committerPaul Hänsch <paul@plutz.net>
Wed, 25 May 2022 21:03:41 +0000 (23:03 +0200)
handlers/20_revision.sh

index bbbc76b4b4299ff76fdade1ae5517e00fbd35f93..08350c7b80855bca4624a5091ea00f760edc6939 100755 (executable)
@@ -22,7 +22,7 @@ case "${PATH_INFO}" in
       theme_error 403
     else
     ( export PATH_INFO="${page}"
-      cd "${_DATA}/pages${page}"
+      cd "${_DATA}/pages${page}" || cd "${_DATA}/pages/"
       git -C "${_DATA}" show "${rev}:pages${PATH_INFO}#page.md" \
       | { printf '<article class="revision">'; md; printf '</article>'; } \
       | theme_page - "${page##*/}"