Use context instead of global vars

This commit is contained in:
Ray Miller 2025-01-20 10:42:15 +00:00
parent 1535baa68b
commit 7f5ec3ac29
Signed by: ray
GPG key ID: 043F786C4CD681B8
13 changed files with 243 additions and 205 deletions

View file

@ -2,8 +2,9 @@
(ice-9 filesystem)
(ordo))
(define* (install-aws-cli conn #:key (url "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip") update? install-dir bin-dir)
(let ((tmp-dir (run conn "mktemp" "-d" #:return car #:check? #t)))
(define* (install-aws-cli #:key (url "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip") update? install-dir bin-dir)
(let* ((conn (current-connection))
(tmp-dir (run conn "mktemp" "-d" #:return car #:check? #t)))
(dynamic-wind
(const #t)
(lambda ()
@ -22,8 +23,7 @@
(play "Test play"
#:host "localhost"
(task "Install AWS CLI"
(lambda (c)
(install-aws-cli c
#:update? #t
(lambda ()
(install-aws-cli #:update? #t
#:install-dir (file-name-join* ($ #:fact.home-dir) ".local" "aws-cli")
#:bin-dir (file-name-join* ($ #:fact.home-dir) ".local" "bin"))))))