about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ravanan/command-line-tool.scm13
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)