aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ravanan/reader.scm10
-rw-r--r--ravanan/work/command-line-tool.scm11
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")