From c706964880db40a60904d3328306676c623aa1b1 Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Fri, 1 Feb 2013 10:47:37 -0500 Subject: [PATCH] Add exit function and use it in post-receive script. Fixes Issue #13. --- NEWS.md | 1 + examples/example.post-receive | 8 +++++--- src/util.lisp | 9 +++++++++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 581568f..3e46fd7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ * Add support for Restructured Text via cl-docutils. * Add support for deploying to Amazon S3. * Add a heroku plugin to ease hunchentoot deployments. (thanks @jsmpereira!) +* Ensure coleslaw exits after MAIN. Fixes issue #13. ## Changes for 0.8 (2013-01-06): diff --git a/examples/example.post-receive b/examples/example.post-receive index 94eec78..7552c57 100644 --- a/examples/example.post-receive +++ b/examples/example.post-receive @@ -1,6 +1,6 @@ ########## CONFIGURATION VALUES ########## -# TMP_GIT_CLONE _must_ match one of the following in coleslawrc: +# TMP_GIT_CLONE _must_ match one of the following in coleslawrc: # * The :repo argument (for a single-site setup) _or_ # * An alist key (for a multi-site setup) TMP_GIT_CLONE=$HOME/tmp/improvedmeans/ @@ -23,9 +23,11 @@ fi git clone $GIT_REPO $TMP_GIT_CLONE || exit 1 if [ $LISP = sbcl ]; then - sbcl --eval "(ql:quickload 'coleslaw)" --eval "(coleslaw:main \"$TMP_GIT_CLONE\")" + sbcl --eval "(ql:quickload 'coleslaw)" \ + --eval "(coleslaw:main \"$TMP_GIT_CLONE\")" \ + --eval "(coleslaw::exit)" elif [ $LISP = ccl ]; then - echo "(ql:quickload 'coleslaw)(coleslaw:main \"$TMP_GIT_CLONE\")" | ccl -b + echo "(ql:quickload 'coleslaw)(coleslaw:main \"$TMP_GIT_CLONE\")(coleslaw::exit)" | ccl -b else exit 1 fi diff --git a/src/util.lisp b/src/util.lisp index 203c57d..b7d0c90 100644 --- a/src/util.lisp +++ b/src/util.lisp @@ -47,6 +47,15 @@ on files that match the given extension." #+clisp (ext:cd path) #-(or sbcl ccl ecl cmucl clisp) (error "Not implemented yet.")) +(defun exit () + "Exit the lisp system returning a 0 status code." + #+sbcl (sb-ext:quit) + #+ccl (ccl:quit) + #+ecl (si:quit) + #+cmucl (ext:quit) + #+clisp (ext:quit) + #-(or sbcl ccl ecl clisp) (error "Not implemented yet.")) + (defmacro with-current-directory (path &body body) "Change the current OS directory to PATH and execute BODY in an UNWIND-PROTECT, then change back to the current directory."