Browse Source

Set the executor for the entire lifetime of with-host

master
Wesley Kerfoot 6 years ago
parent
commit
91e3663005
  1. 8
      bolt/bolt.rkt

8
bolt/bolt.rkt

@ -26,6 +26,9 @@
(define commands (define commands
(make-parameter #f)) (make-parameter #f))
(define executor
(make-parameter #f))
(define-syntax-rule (define-syntax-rule
(plan expr ...) (plan expr ...)
(parameterize (parameterize
@ -45,7 +48,8 @@
(with-host remote expr ...) (with-host remote expr ...)
(parameterize (parameterize
([host remote] ([host remote]
[hostname (remote-host remote)]) [hostname (remote-host remote)]
[executor (make-exec (remote-host remote))])
(begin expr ...))) (begin expr ...)))
(define-syntax-rule (define-syntax-rule
@ -66,7 +70,7 @@
(displayln (displayln
(format "Executed on ~a:" (remote-host (host)))) (format "Executed on ~a:" (remote-host (host))))
(match (match
((make-exec (hostname)) ((executor)
(as-user (as-user
(format "cd ~a && ~a ~a" (format "cd ~a && ~a ~a"
(cwd) (cwd)

Loading…
Cancel
Save