diff options
author | Arun Isaac | 2025-04-17 19:55:01 +0100 |
---|---|---|
committer | Arun Isaac | 2025-04-17 19:55:01 +0100 |
commit | 37b9bbb7c7b4766547defd222be23b74efdd7cc9 (patch) | |
tree | db2898c9292bd81341c45a01781edd4c0163d429 | |
parent | 993ebca4245c97268a418ab683adb820839e666f (diff) | |
download | ravanan-37b9bbb7c7b4766547defd222be23b74efdd7cc9.tar.gz ravanan-37b9bbb7c7b4766547defd222be23b74efdd7cc9.tar.lz ravanan-37b9bbb7c7b4766547defd222be23b74efdd7cc9.zip |
command-line-tool: Abstract out file staging into its own function.
*
ravanan/command-line-tool.scm (build-command-line-tool-script)[stage-file]:
New function.
[stage-files]: Use stage-file.
-rw-r--r-- | ravanan/command-line-tool.scm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/ravanan/command-line-tool.scm b/ravanan/command-line-tool.scm index 6843ff5..51f14c2 100644 --- a/ravanan/command-line-tool.scm +++ b/ravanan/command-line-tool.scm @@ -988,6 +988,13 @@ directory of the workflow." ((eq? matched-type 'null) 'null)))))) + (define (stage-file file entry-name) + ;; Stage file as entry-name and return the staged File value. + (rename-file (assoc-ref* file "path") + entry-name) + (canonicalize-file-value `(("class" . "File") + ("path" . ,entry-name)))) + ;; Stage files. ;; We currently support File and Dirent only. TODO: Support others. (define (stage-files entries outputs-directory) @@ -1005,12 +1012,8 @@ directory of the workflow." ((eq? (object-type entry) 'File) ;; TODO: Stage secondary files too? - (rename-file (assoc-ref* entry "path") - entry-name) (cons entry - (canonicalize-file-value - `(("class" . "File") - ("path" . ,entry-name)))))))) + (stage-file entry entry-name)))))) entries)) (define (set-staged-path input staging-mapping) |