Add clojure task

This commit is contained in:
Michiel Borkent 2021-03-27 21:31:31 +01:00
parent ed40991c56
commit a1bf6692d0
2 changed files with 12 additions and 0 deletions

View file

@ -622,6 +622,8 @@ Use -- to separate script command line args from bb command line args.
(let [main-arg (first args) (let [main-arg (first args)
cmd-line-args (rest args)] cmd-line-args (rest args)]
(parse-opts (seq (map str (concat ["--main" main-arg] cmd-line-args command-line-args))))) (parse-opts (seq (map str (concat ["--main" main-arg] cmd-line-args command-line-args)))))
clojure
(parse-opts (seq (map str (concat ["--clojure"] args command-line-args))))
do do
{:do (map #(resolve-task tasks % nil) args)} {:do (map #(resolve-task tasks % nil) args)}
;; default ;; default

View file

@ -164,3 +164,13 @@ Addition is a pretty advanced topic. Let us start with the identity element
(is (fs/exists? temp-file)) (is (fs/exists? temp-file))
(bb :hello) (bb :hello)
(is (not (fs/exists? temp-file)))))) (is (not (fs/exists? temp-file))))))
(deftest clojure-test
(let [temp-dir (fs/create-temp-dir)
temp-file (fs/create-file (fs/path temp-dir "temp-file.txt"))]
(with-config {:tasks {:jvm ['clojure "-M" "-e"
(format "(do (require '[clojure.java.io :as io])
(.delete (io/file \"%s\")))" (str temp-file))]}}
(is (fs/exists? temp-file))
(bb :jvm)
(is (not (fs/exists? temp-file))))))