From 2e03da3e01ed75a398508518cace74a5e750fa96 Mon Sep 17 00:00:00 2001 From: Ray Miller Date: Fri, 10 Jan 2025 16:03:45 +0000 Subject: [PATCH] Get rid of scratch-dir from context Leave it to the actions to deal with their own temporary file clean-up. --- modules/ordo/context.scm | 3 --- modules/ordo/play.scm | 18 ++++++------------ 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/modules/ordo/context.scm b/modules/ordo/context.scm index 1da0015..06512b1 100644 --- a/modules/ordo/context.scm +++ b/modules/ordo/context.scm @@ -7,8 +7,6 @@ #:export (make-context context? context-connection - context-scratch-dir - set-context-scratch-dir! add-context-triggers! get-context-triggers context-triggered? @@ -22,7 +20,6 @@ (make-context connection vars) context? (connection context-connection) - (scratch-dir context-scratch-dir set-context-scratch-dir!) (vars context-vars set-context-vars!) (triggers context-triggers set-context-triggers!)) diff --git a/modules/ordo/play.scm b/modules/ordo/play.scm index 8d0450c..c04be7a 100644 --- a/modules/ordo/play.scm +++ b/modules/ordo/play.scm @@ -62,16 +62,10 @@ (play-connection play) (lambda (c) (let* ((ctx (make-context c (play-vars play)))) - (set-context-scratch-dir! ctx (first (must ctx "mktemp" '("--directory")))) - (dynamic-wind - (const #t) - (lambda () - (for-each (cut run-task ctx <>) (play-tasks play)) - (for-each (match-lambda - ((name . handler) - (when (context-triggered? ctx name) - (run-handler ctx handler)))) - (play-handlers play))) - (lambda () - (must ctx "rm" `("-rf" ,(context-scratch-dir ctx)))))))) + (for-each (cut run-task ctx <>) (play-tasks play)) + (for-each (match-lambda + ((name . handler) + (when (context-triggered? ctx name) + (run-handler ctx handler)))) + (play-handlers play))))) (format #t "COMPLETED PLAY ~a~%" (play-description play)))