|
@ -2,6 +2,11 @@ |
|
|
|
|
|
|
|
|
(require remote-shell/ssh) |
|
|
(require remote-shell/ssh) |
|
|
|
|
|
|
|
|
|
|
|
(define (strip-first-line st) |
|
|
|
|
|
(string-join |
|
|
|
|
|
(cdr |
|
|
|
|
|
(string-split st "\n")))) |
|
|
|
|
|
|
|
|
(define cwd |
|
|
(define cwd |
|
|
(make-parameter "~")) |
|
|
(make-parameter "~")) |
|
|
|
|
|
|
|
@ -52,12 +57,20 @@ |
|
|
(define (exec cmd) |
|
|
(define (exec cmd) |
|
|
(displayln |
|
|
(displayln |
|
|
(format "Executed on ~a:" (remote-host (host)))) |
|
|
(format "Executed on ~a:" (remote-host (host)))) |
|
|
|
|
|
(match |
|
|
(ssh (host) |
|
|
(ssh (host) |
|
|
(as-user |
|
|
(as-user |
|
|
(string-append |
|
|
(string-append |
|
|
(format "cd ~a && " |
|
|
(format "cd ~a && " |
|
|
(cwd)) |
|
|
(cwd)) |
|
|
cmd)))) |
|
|
cmd)) |
|
|
|
|
|
#:failure-log "/tmp/test.log" |
|
|
|
|
|
#:mode 'output) |
|
|
|
|
|
[(cons code output) |
|
|
|
|
|
(cons code |
|
|
|
|
|
(strip-first-line |
|
|
|
|
|
(bytes->string/utf-8 output)))] |
|
|
|
|
|
[output output])) |
|
|
|
|
|
|
|
|
(define ((make-cmd cmd)) (exec cmd)) |
|
|
(define ((make-cmd cmd)) (exec cmd)) |
|
|
|
|
|
|
|
|