From 983bfc89c52d16583693e0d0233f665222195152 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 22 Jun 2026 01:34:14 +0100 Subject: scripts: Change directory before loading source files. --- scripts/ccwl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/scripts/ccwl b/scripts/ccwl index 34a45c0..65d338b 100755 --- a/scripts/ccwl +++ b/scripts/ccwl @@ -37,7 +37,8 @@ exec guile --no-auto-compile -e main -s "$0" "$@" (ccwl conditions) (ccwl cwl) (ccwl graphviz) - (ccwl ui)) + (ccwl ui) + (ccwl utils)) (define (invalid-option opt name arg result) (error "Invalid option" name)) @@ -86,8 +87,14 @@ exec guile --no-auto-compile -e main -s "$0" "$@" ((ccwl-violation? exception) (report-ccwl-violation exception) (exit #f))) - (load (canonicalize-path source) - read-syntax)))) + (let ((source-path (canonicalize-path source))) + ;; Change directory before loading source file. + ;; The source file may reference other files with + ;; paths relative to its directory. + (call-with-current-directory (dirname source-path) + (lambda () + (load source-path + read-syntax))))))) (if (or (command? result) (js-expression? result) (workflow? result)) -- cgit 1.4.1