diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-09 09:56:41 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-09 09:56:41 -0700 |
commit | 734a62c560278b585996ef9579d4fdc1407d25d3 (patch) | |
tree | 2ce4a0c5de9ce7bd88fce3e334d1621ce94f9a1c | |
parent | ae26dd63fbf5bed4505970eeb686bb026352eb3f (diff) | |
download | consfigurator-734a62c560278b585996ef9579d4fdc1407d25d3.tar.gz |
when RUN/MRUN get :PRINC, ensure print even if command fails
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/connection.lisp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/connection.lisp b/src/connection.lisp index 5398bf5..f30fbd4 100644 --- a/src/connection.lisp +++ b/src/connection.lisp @@ -282,9 +282,9 @@ case return only the exit code." (multiple-value-bind (err exit) (connection-run *connection* cmd input) (let ((out (readfile stdout))) + (when princ (format t "~{ ~A~%~}" (lines out))) (if (or may-fail (= exit 0)) - (progn (when princ (format t "~{ ~A~%~}" (lines out))) - (if for-exit exit (values out err exit))) + (if for-exit exit (values out err exit)) (error 'run-failed :cmd cmd :stdout out :stderr err :exit-code exit))))))) @@ -302,10 +302,10 @@ separate the streams might want to use this too, but usually it is best to start with RUN." (%process-run-args (multiple-value-bind (out exit) - (connection-run *connection* cmd input) + (connection-run *connection* cmd input) + (when princ (format t "~{ ~A~%~}" (lines out))) (if (or may-fail (= exit 0)) - (progn (when princ (format t "~{ ~A~%~}" (lines out))) - (if for-exit exit (values out exit))) + (if for-exit exit (values out exit)) (error 'run-failed :cmd cmd :stdout out |