diff options
author | Arun Isaac | 2025-04-22 21:53:46 +0100 |
---|---|---|
committer | Arun Isaac | 2025-04-22 22:17:24 +0100 |
commit | 28b3b6bc233a0797d16372688d760fe0b2b6fd52 (patch) | |
tree | efbf1de7e3e046d7e4cd720300db65aec41ca154 | |
parent | 6a21604aefd2bfdc86aa3d5c968880270b88853c (diff) | |
download | ravanan-28b3b6bc233a0797d16372688d760fe0b2b6fd52.tar.gz ravanan-28b3b6bc233a0797d16372688d760fe0b2b6fd52.tar.lz ravanan-28b3b6bc233a0797d16372688d760fe0b2b6fd52.zip |
reader: Move location->path to work module.
* ravanan/reader.scm (location->path): Move to ...
* ravanan/work/command-line-tool.scm (location->path): ... here.
-rw-r--r-- | ravanan/reader.scm | 10 | ||||
-rw-r--r-- | ravanan/work/command-line-tool.scm | 11 |
2 files changed, 11 insertions, 10 deletions
diff --git a/ravanan/reader.scm b/ravanan/reader.scm index 577ba97..a28ce94 100644 --- a/ravanan/reader.scm +++ b/ravanan/reader.scm @@ -21,7 +21,6 @@ #:use-module (srfi srfi-26) #:use-module (ice-9 filesystem) #:use-module (ice-9 match) - #:use-module (web uri) #:use-module (json) #:use-module (yaml) #:use-module (ravanan work command-line-tool) @@ -256,15 +255,6 @@ array of array of @code{File}s, etc. Else, return @code{#f}" (cut normalize-workflow (preprocess-include (read-yaml-file (basename workflow-file)))))) -(define (location->path location) - "Convert file @var{location} URI to path. Tolerate invalid locations that are -actually paths." - (cond - ;; If location is an URI, parse the URI and return the path part. - ((string->uri location) => uri-path) - ;; location is actually a path; return as is. - (else location))) - (define (normalize-input input) "Normalize actual @var{input}." (cond diff --git a/ravanan/work/command-line-tool.scm b/ravanan/work/command-line-tool.scm index ec8a8a3..0d1c592 100644 --- a/ravanan/work/command-line-tool.scm +++ b/ravanan/work/command-line-tool.scm @@ -23,6 +23,7 @@ #:use-module (ice-9 filesystem) #:use-module (ice-9 format) #:use-module (ice-9 match) + #:use-module (web uri) #:use-module (gcrypt base16) #:use-module (gcrypt hash) #:use-module (json) @@ -37,6 +38,7 @@ run-command sha1-hash checksum + location->path canonicalize-file-value evaluate-javascript)) @@ -207,6 +209,15 @@ status in @var{success-codes} as success. Error out otherwise." "Return the checksum of @var{file} as defined in the CWL specification." (string-append "sha1$" (sha1-hash file))) +(define (location->path location) + "Convert file @var{location} URI to path. Tolerate invalid locations that are +actually paths." + (cond + ;; If location is an URI, parse the URI and return the path part. + ((string->uri location) => uri-path) + ;; location is actually a path; return as is. + (else location))) + (define (canonicalize-file-value value) "Canonicalize @code{File} type @var{value} adding missing fields." (let ((path (or (assoc-ref value "location") |