Ver código fonte

Add exit function and use it in post-receive script. Fixes Issue #13.

Brit Butler 12 anos atrás
pai
commit
c706964880
3 arquivos alterados com 15 adições e 3 exclusões
  1. 1 0
      NEWS.md
  2. 5 3
      examples/example.post-receive
  3. 9 0
      src/util.lisp

+ 1 - 0
NEWS.md

@@ -4,6 +4,7 @@
4 4
 * Add support for Restructured Text via cl-docutils.
5 5
 * Add support for deploying to Amazon S3.
6 6
 * Add a heroku plugin to ease hunchentoot deployments. (thanks @jsmpereira!)
7
+* Ensure coleslaw exits after MAIN. Fixes issue #13.
7 8
 
8 9
 ## Changes for 0.8 (2013-01-06):
9 10
 

+ 5 - 3
examples/example.post-receive

@@ -1,6 +1,6 @@
1 1
 ########## CONFIGURATION VALUES ##########
2 2
 
3
-# TMP_GIT_CLONE _must_ match one of the following in coleslawrc: 
3
+# TMP_GIT_CLONE _must_ match one of the following in coleslawrc:
4 4
 #   * The :repo argument (for a single-site setup) _or_
5 5
 #   * An alist key (for a multi-site setup)
6 6
 TMP_GIT_CLONE=$HOME/tmp/improvedmeans/
@@ -23,9 +23,11 @@ fi
23 23
 git clone $GIT_REPO $TMP_GIT_CLONE || exit 1
24 24
 
25 25
 if [ $LISP = sbcl ]; then
26
-    sbcl --eval "(ql:quickload 'coleslaw)" --eval "(coleslaw:main \"$TMP_GIT_CLONE\")"
26
+    sbcl --eval "(ql:quickload 'coleslaw)" \
27
+         --eval "(coleslaw:main \"$TMP_GIT_CLONE\")" \
28
+         --eval "(coleslaw::exit)"
27 29
 elif [ $LISP = ccl ]; then
28
-    echo "(ql:quickload 'coleslaw)(coleslaw:main \"$TMP_GIT_CLONE\")" | ccl -b
30
+    echo "(ql:quickload 'coleslaw)(coleslaw:main \"$TMP_GIT_CLONE\")(coleslaw::exit)" | ccl -b
29 31
 else
30 32
     exit 1
31 33
 fi

+ 9 - 0
src/util.lisp

@@ -47,6 +47,15 @@ on files that match the given extension."
47 47
   #+clisp (ext:cd path)
48 48
   #-(or sbcl ccl ecl cmucl clisp) (error "Not implemented yet."))
49 49
 
50
+(defun exit ()
51
+  "Exit the lisp system returning a 0 status code."
52
+  #+sbcl (sb-ext:quit)
53
+  #+ccl (ccl:quit)
54
+  #+ecl (si:quit)
55
+  #+cmucl (ext:quit)
56
+  #+clisp (ext:quit)
57
+  #-(or sbcl ccl ecl clisp) (error "Not implemented yet."))
58
+
50 59
 (defmacro with-current-directory (path &body body)
51 60
   "Change the current OS directory to PATH and execute BODY in
52 61
 an UNWIND-PROTECT, then change back to the current directory."