From 91e3663005b98056879a0a9116b3f8ac10f7417c Mon Sep 17 00:00:00 2001 From: Wesley Kerfoot Date: Sat, 22 Dec 2018 15:47:31 -0500 Subject: [PATCH] Set the executor for the entire lifetime of with-host --- bolt/bolt.rkt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bolt/bolt.rkt b/bolt/bolt.rkt index 1eb69b1..d8737e8 100755 --- a/bolt/bolt.rkt +++ b/bolt/bolt.rkt @@ -26,6 +26,9 @@ (define commands (make-parameter #f)) +(define executor + (make-parameter #f)) + (define-syntax-rule (plan expr ...) (parameterize @@ -45,7 +48,8 @@ (with-host remote expr ...) (parameterize ([host remote] - [hostname (remote-host remote)]) + [hostname (remote-host remote)] + [executor (make-exec (remote-host remote))]) (begin expr ...))) (define-syntax-rule @@ -66,7 +70,7 @@ (displayln (format "Executed on ~a:" (remote-host (host)))) (match - ((make-exec (hostname)) + ((executor) (as-user (format "cd ~a && ~a ~a" (cwd)