From ce07104835149c09aae78fac5ecc71bd682c5178 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 18 Aug 2025 14:22:29 +0100 Subject: work/command-line-tool: Always reconstruct location from path. --- ravanan/work/command-line-tool.scm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ravanan/work/command-line-tool.scm b/ravanan/work/command-line-tool.scm index 38673a0..ef09658 100644 --- a/ravanan/work/command-line-tool.scm +++ b/ravanan/work/command-line-tool.scm @@ -253,10 +253,12 @@ condition on unsupported URI schemes." (define (canonicalize-file-value value) "Canonicalize @code{File} type @var{value} adding missing fields." - (let ((path (or (assoc-ref value "path") - (location->path (assoc-ref value "location")))) - (location (or (assoc-ref value "location") - (string-append "file://" (assoc-ref value "path"))))) + (let* ((path (or (assoc-ref value "path") + (location->path (assoc-ref value "location")))) + ;; The location field may actually be a path instead of an URI; that's + ;; invalid. So, unconditionally reconstruct the location URI from path. + ;; This assumes they are always file:// URIs, but that works for now. + (location (string-append "file://" path))) ;; Populate all fields of the File type value. (maybe-assoc-set `(("class" . "File") ("location" . ,location) -- cgit 1.4.1