Flexible Lisp Blogware. Fork for personal use. Mirrored from https://github.com/kingcons/coleslaw originally.

example.post-receive 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. ########## CONFIGURATION VALUES ##########
  2. TMP_GIT_CLONE=$HOME/tmp/improvedmeans/
  3. # Set LISP to your preferred implementation. The following
  4. # implementations are currently supported:
  5. # * sbcl
  6. # * ccl
  7. LISP=sbcl
  8. ########## DON'T EDIT ANYTHING BELOW THIS LINE ##########
  9. if cd `dirname "$0"`/..; then
  10. GIT_REPO=`pwd`
  11. cd $OLDPWD || exit 1
  12. else
  13. exit 1
  14. fi
  15. git clone $GIT_REPO $TMP_GIT_CLONE || exit 1
  16. while read oldrev newrev refname; do
  17. if [ $refname = "refs/heads/master" ]; then
  18. echo -e "\n Master updated. Running coleslaw...\n"
  19. if [ $LISP = sbcl ]; then
  20. sbcl --eval "(ql:quickload 'coleslaw)" \
  21. --eval "(coleslaw:main \"$TMP_GIT_CLONE\" \"$oldrev\")" \
  22. --eval "(uiop:quit)"
  23. elif [ $LISP = ccl ]; then
  24. ccl -e "(ql:quickload 'coleslaw) (coleslaw:main \"$TMP_GIT_CLONE\" \"$oldrev\") (uiop:quit)"
  25. else
  26. echo -e "$LISP is not a supported lisp dialect at this time. Exiting.\n"
  27. exit 1
  28. fi
  29. fi
  30. done
  31. rm -rf $TMP_GIT_CLONE
  32. exit