Utility module for working with slope modules
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
777 B

;;;
;;; modules - Module management utilities
;;; Author: sloum
;;; Version: 0.1.0
;;;
;; Takes any number of strings and verifies if the
;; given modules are available to the current runtime
(define mod-exists? (lambda (...)
(equal? 0
(length
(filter
(lambda (b) (equal? #f b))
(map
(lambda (v)
(or
(path-exists? (path-join (mod-path) v))
(path-exists? (path-join "/usr/local/lib/slope/modules" v))))
...))))))
(define _USAGE [
["mod-exists?" "(mod-exists? [module-name: string...]) => bool\n\nChecks if the given module is installed on the system and available to the current runtime. `#t` will only be returned if all of the given modules are present (it functions like `and`)"]])