diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-02-26 17:13:20 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-02-27 08:33:17 -0700 |
commit | e79092a8b245a2064ebc3759a2b1543ba36f950f (patch) | |
tree | 75dae38d4ca6c215950c2725d2d9413ee13eca62 /src/connection/shell-wrap.lisp | |
parent | b1688ced028a63e6817e97f490ecf081d45c14c9 (diff) | |
download | consfigurator-e79092a8b245a2064ebc3759a2b1543ba36f950f.tar.gz |
fix shell-wrap's CONNECTION-RUN and CONNECTION-WRITEFILE
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/connection/shell-wrap.lisp')
-rw-r--r-- | src/connection/shell-wrap.lisp | 12 |
1 files changed, 7 insertions, 5 deletions
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))) |