]> git.plutz.net Git - invoices/blobdiff - invoices.cgi
support for git versioning of data
[invoices] / invoices.cgi
index 71ab2b1e79a6aa540ec0167c3648ba4e4e7b725e..76d989a0dffbee3c28ebb490dafcdba04c15d8c3 100755 (executable)
@@ -35,6 +35,15 @@ tid(){
 
 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"