diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-02-23 17:16:53 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-02-23 17:16:53 -0700 |
commit | 7219c56f4c876ead5c36203b78f80367a839cf96 (patch) | |
tree | 1c6483a441500cd5e5e479e8d3e38856452fe2ac | |
parent | cfd10c04d15d21a9a9108a03056f07ba681288ab (diff) | |
download | consfigurator-7219c56f4c876ead5c36203b78f80367a839cf96.tar.gz |
switch redirection in RUN
Better to capture the stderr directly in case something goes wrong and we
can't read the temporary file.
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r-- | src/connection.lisp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/connection.lisp b/src/connection.lisp index bec5c23..7f9ee73 100644 --- a/src/connection.lisp +++ b/src/connection.lisp @@ -207,11 +207,11 @@ Returns command's stdout, stderr and exit code." (setq cmd (format nil "env ~{~A~^ ~} ~A" (escape-sh-command accum) cmd)))) - (with-remote-temporary-file (stderr) - (setq cmd (format nil "( ~A ) 2>~A" cmd stderr)) - (multiple-value-bind (out exit) + (with-remote-temporary-file (stdout) + (setq cmd (format nil "( ~A ) >~A" cmd stdout)) + (multiple-value-bind (err exit) (connection-run *connection* cmd input) - (let ((err (readfile stderr))) + (let ((out (readfile stdout))) (if (or may-fail (= exit 0)) (values out err exit) (error 'run-failed |