info="$(PATH "${PATH_INFO}")"
+which git && [ ! -d .git ] && {
+ git init
+ mkdir -p clients/ invoices/ senders/
+ printf 'export/
+serverkey' >.gitignore
+ git add clients/ invoices/ senders/ .gitignore
+ git commit -m 'initialisation of invoice repo'
+} >&2
+
case $info in
/invoices.css)
. "$_EXEC/cgilite/file.sh"
. "$_EXEC/invoices.sh"
update_invoice
;;
- /export/*.pdf)
+ /export/*.pdf/*)
. "$_EXEC/cgilite/file.sh"
- FILE "${info#/}" application/pdf
+ file="${info%/*}"
+ FILE "${file#/}" application/pdf
;;
*) REDIRECT /invoices
;;