]> git.plutz.net Git - lobster/commitdiff
provide debug function
authorPaul Hänsch <paul@plutz.net>
Sun, 19 Jan 2020 17:03:32 +0000 (18:03 +0100)
committerPaul Hänsch <paul@plutz.net>
Sun, 19 Jan 2020 17:03:32 +0000 (18:03 +0100)
index.cgi

index 4531b0ad608a84c215a9a8b64cd9f00ae0568543..9d9a3e7090f3441b760c321d16407be17cb0e4e0 100755 (executable)
--- a/index.cgi
+++ b/index.cgi
@@ -9,7 +9,15 @@ esac; done
 [ -z "${_EXEC%/}" ] && _EXEC="$(realpath "${0%/*}")" || _EXEC="${_EXEC%/}"
 [ -z "${_DATA%/}" ] && _DATA=. || _DATA="${_DATA%/}"
 
-debug() { :; }
+# debug() {
+#   local dbg=/dev/stderr
+#   if [ "$#" -gt 0 ]; then
+#     printf '%s\n' "$@" >>"$dbg"
+#   else
+#     tee -a "$dbg"
+#   fi
+# }
+debug() { [ "$#" -gt 0 ] && : || cat; }
 
 . "$_EXEC/cgilite/cgilite.sh"
 . "$_EXEC/cgilite/session.sh"