aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2024-10-02 01:51:29 +0100
committerArun Isaac2024-10-02 02:08:58 +0100
commit1cd44d048a5bad9361dc70b1b9cd007dd687ac3a (patch)
tree435d4d0b062ef07c08efddddd30d70f8633210c7
parentbab6bc40bb62c153c7a7f2deb5222a1f8bffbce9 (diff)
downloadravanan-1cd44d048a5bad9361dc70b1b9cd007dd687ac3a.tar.gz
ravanan-1cd44d048a5bad9361dc70b1b9cd007dd687ac3a.tar.lz
ravanan-1cd44d048a5bad9361dc70b1b9cd007dd687ac3a.zip
command-line-tool: Promote find-requirement to top level.
* ravanan/command-line-tool.scm (build-command-line-tool-script)[find-requirement]: Promote to top level.
-rw-r--r--ravanan/command-line-tool.scm14
1 files changed, 8 insertions, 6 deletions
diff --git a/ravanan/command-line-tool.scm b/ravanan/command-line-tool.scm
index 205ab48..2c48ca3 100644
--- a/ravanan/command-line-tool.scm
+++ b/ravanan/command-line-tool.scm
@@ -569,6 +569,14 @@ order of keys."
;; Atoms
(else tree)))
+(define (find-requirement requirements class)
+ "Find requirement of @var{class} among @var{requirements} and return a
+maybe-monadic value."
+ (maybe-vector-find (lambda (requirement)
+ (string=? (assoc-ref* requirement "class")
+ class))
+ requirements))
+
(define (build-command-line-tool-script name manifest cwl inputs
scratch store batch-system
guix-daemon-socket)
@@ -578,12 +586,6 @@ named @var{name} with @var{inputs} using tools from Guix manifest
@var{scratch}, @var{store} and @var{guix-daemon-socket} are the same as in
@code{run-workflow} from @code{(ravanan workflow)}."
- (define (find-requirement requirements class)
- (maybe-vector-find (lambda (requirement)
- (string=? (assoc-ref* requirement "class")
- class))
- requirements))
-
(define (environment-variables env-var-requirement)
(just (vector-map->list (lambda (environment-definition)
#~(list #$(assoc-ref* environment-definition