aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-02-23 17:16:53 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-02-23 17:16:53 -0700
commit7219c56f4c876ead5c36203b78f80367a839cf96 (patch)
tree1c6483a441500cd5e5e479e8d3e38856452fe2ac
parentcfd10c04d15d21a9a9108a03056f07ba681288ab (diff)
downloadconsfigurator-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.lisp8
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