From e79092a8b245a2064ebc3759a2b1543ba36f950f Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 26 Feb 2021 17:13:20 -0700 Subject: fix shell-wrap's CONNECTION-RUN and CONNECTION-WRITEFILE Signed-off-by: Sean Whitton --- src/connection/shell-wrap.lisp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/connection/shell-wrap.lisp') diff --git a/src/connection/shell-wrap.lisp b/src/connection/shell-wrap.lisp index 34070ee..e56aad4 100644 --- a/src/connection/shell-wrap.lisp +++ b/src/connection/shell-wrap.lisp @@ -28,11 +28,13 @@ (defmethod connection-readfile ((c shell-wrap-connection) path) (multiple-value-bind (out exit) (let ((path (escape-sh-token path))) - (mrun :may-fail - (connection-shell-wrap c #?"test -r ${path} && cat ${path}"))) + (connection-run c #?"test -r ${path} && cat ${path}" nil)) (if (= 0 exit) out (error "File ~S not readable" path)))) -(defmethod connection-writefile ((c shell-wrap-connection) path contents) +(defmethod connection-writefile ((conn shell-wrap-connection) path contents) (with-remote-temporary-file (temp) - (mrun :input contents (connection-shell-wrap c #?"cat >${temp}")) - (mrun "mv" temp path))) + (connection-run conn #?"cat >${temp}" contents) + (connection-run + conn + #?"mv ${(escape-sh-token temp)} ${(escape-sh-token path)}" + nil))) -- cgit v1.2.3