Get rid of scratch-dir from context
Leave it to the actions to deal with their own temporary file clean-up.
This commit is contained in:
parent
0550ab5b60
commit
2e03da3e01
2 changed files with 6 additions and 15 deletions
|
@ -7,8 +7,6 @@
|
||||||
#:export (make-context
|
#:export (make-context
|
||||||
context?
|
context?
|
||||||
context-connection
|
context-connection
|
||||||
context-scratch-dir
|
|
||||||
set-context-scratch-dir!
|
|
||||||
add-context-triggers!
|
add-context-triggers!
|
||||||
get-context-triggers
|
get-context-triggers
|
||||||
context-triggered?
|
context-triggered?
|
||||||
|
@ -22,7 +20,6 @@
|
||||||
(make-context connection vars)
|
(make-context connection vars)
|
||||||
context?
|
context?
|
||||||
(connection context-connection)
|
(connection context-connection)
|
||||||
(scratch-dir context-scratch-dir set-context-scratch-dir!)
|
|
||||||
(vars context-vars set-context-vars!)
|
(vars context-vars set-context-vars!)
|
||||||
(triggers context-triggers set-context-triggers!))
|
(triggers context-triggers set-context-triggers!))
|
||||||
|
|
||||||
|
|
|
@ -62,16 +62,10 @@
|
||||||
(play-connection play)
|
(play-connection play)
|
||||||
(lambda (c)
|
(lambda (c)
|
||||||
(let* ((ctx (make-context c (play-vars play))))
|
(let* ((ctx (make-context c (play-vars play))))
|
||||||
(set-context-scratch-dir! ctx (first (must ctx "mktemp" '("--directory"))))
|
(for-each (cut run-task ctx <>) (play-tasks play))
|
||||||
(dynamic-wind
|
(for-each (match-lambda
|
||||||
(const #t)
|
((name . handler)
|
||||||
(lambda ()
|
(when (context-triggered? ctx name)
|
||||||
(for-each (cut run-task ctx <>) (play-tasks play))
|
(run-handler ctx handler))))
|
||||||
(for-each (match-lambda
|
(play-handlers play)))))
|
||||||
((name . handler)
|
|
||||||
(when (context-triggered? ctx name)
|
|
||||||
(run-handler ctx handler))))
|
|
||||||
(play-handlers play)))
|
|
||||||
(lambda ()
|
|
||||||
(must ctx "rm" `("-rf" ,(context-scratch-dir ctx))))))))
|
|
||||||
(format #t "COMPLETED PLAY ~a~%" (play-description play)))
|
(format #t "COMPLETED PLAY ~a~%" (play-description play)))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue