Skip to content
Snippets Groups Projects
Commit 9984a223 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

2.0.1: for on-error, use call-function not error-behaviour.

It's more general, but it's also SLIGHTLY INCOMPATIBLE,
depending on values provided. So BEWARE!
parent 1413d010
No related branches found
Tags 2.002
No related merge requests found
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
(defsystem "inferior-shell" (defsystem "inferior-shell"
:description "spawn local or remote processes and shell pipes" :description "spawn local or remote processes and shell pipes"
:version "2.0.0" :version "2.0.1"
:defsystem-depends-on (:asdf #-asdf3 "uiop") :defsystem-depends-on (:asdf #-asdf3 "uiop")
:depends-on ((:version #+asdf3 "asdf" #-asdf3 "uiop" "3.0.3") ; input and error-output redirection :depends-on ((:version #+asdf3 "asdf" #-asdf3 "uiop" "3.0.3") ; input and error-output redirection
#+sbcl "sb-posix" #+sbcl "sb-posix"
......
...@@ -52,15 +52,15 @@ ...@@ -52,15 +52,15 @@
(apply 'run-process-spec (funcall host spec) :host nil keys)))) (apply 'run-process-spec (funcall host spec) :host nil keys))))
(defun run/nil (cmd &rest keys (defun run/nil (cmd &rest keys
&key time show host &key time show host
(on-error (list "Command ~S failed~@[ on ~A~]" cmd host)) (on-error 'signal)
&allow-other-keys) &allow-other-keys)
"run command CMD" "run command CMD"
(labels ((process-time () (labels ((process-time ()
(if time (time (process-command)) (process-command))) (if time (time (process-command)) (process-command)))
(process-command () (process-command ()
(handler-bind (handler-bind
((subprocess-error #'(lambda (c) (error-behavior on-error c)))) ((subprocess-error #'(lambda (c) (call-function on-error c))))
(apply 'run-process-spec cmd :ignore-error-status nil :host host keys)))) (apply 'run-process-spec cmd :ignore-error-status nil :host host keys))))
(when show (when show
(format *trace-output* "; ~A~%" (print-process-spec cmd))) (format *trace-output* "; ~A~%" (print-process-spec cmd)))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment