summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tissue/utils.scm8
1 files changed, 4 insertions, 4 deletions
diff --git a/tissue/utils.scm b/tissue/utils.scm
index 84bafa5..59c0b0a 100644
--- a/tissue/utils.scm
+++ b/tissue/utils.scm
@@ -81,10 +81,10 @@ directory after THUNK returns."
thunk
(cut chdir original-current-directory))))
-(define (call-with-temporary-directory proc)
- "Call PROC with a new temporary directory, and delete it when PROC
-returns or exits non-locally."
- (let ((temporary-directory (mkdtemp "XXXXXX")))
+(define* (call-with-temporary-directory proc #:optional (parent-directory (getcwd)))
+ "Call PROC with a new temporary directory in PARENT-DIRECTORY, and
+delete it when PROC returns or exits non-locally."
+ (let ((temporary-directory (mkdtemp (string-append parent-directory "/XXXXXX"))))
(dynamic-wind (const #t)
(cut proc temporary-directory)
(lambda ()