Fix #1472: fix double tokenization when calling clojure from tasks
This commit is contained in:
parent
7c2e8a155f
commit
a464b59bc2
3 changed files with 10 additions and 9 deletions
|
|
@ -9,7 +9,7 @@ A preview of the next release can be installed from
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
...
|
- [#1472](https://github.com/babashka/babashka/issues/1472): fix tokenization of `babashka.tasks/clojure`: command was tokenized twice
|
||||||
|
|
||||||
## 1.1.171 (2023-01-23)
|
## 1.1.171 (2023-01-23)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,9 +82,6 @@
|
||||||
(update opts :err io/file)
|
(update opts :err io/file)
|
||||||
opts)
|
opts)
|
||||||
opts)
|
opts)
|
||||||
cmd (if (.exists (io/file cmd))
|
|
||||||
[cmd]
|
|
||||||
(p/tokenize cmd))
|
|
||||||
cmd (into cmd args)
|
cmd (into cmd args)
|
||||||
local-log-level (:log-level opts)]
|
local-log-level (:log-level opts)]
|
||||||
(sci/binding [log-level (or local-log-level @log-level)]
|
(sci/binding [log-level (or local-log-level @log-level)]
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,11 @@
|
||||||
[clojure.test :as test :refer [deftest is testing]]))
|
[clojure.test :as test :refer [deftest is testing]]))
|
||||||
|
|
||||||
(defn bb [& args]
|
(defn bb [& args]
|
||||||
(edn/read-string
|
(let [edn-str (apply test-utils/bb nil (map str args))]
|
||||||
{:readers *data-readers*
|
(edn/read-string
|
||||||
:eof nil}
|
{:readers *data-readers*
|
||||||
(apply test-utils/bb nil (map str args))))
|
:eof nil}
|
||||||
|
edn-str)))
|
||||||
|
|
||||||
(deftest dependency-test
|
(deftest dependency-test
|
||||||
(is (= #{:a :c :b} (bb "
|
(is (= #{:a :c :b} (bb "
|
||||||
|
|
@ -102,7 +103,10 @@ true
|
||||||
(bb (-> template (str/replace ":gitlibs" (pr-str (str libs-dir2)))
|
(bb (-> template (str/replace ":gitlibs" (pr-str (str libs-dir2)))
|
||||||
(str/replace ":env-key" ":extra-env")))
|
(str/replace ":env-key" ":extra-env")))
|
||||||
(is (fs/exists? libs-dir))
|
(is (fs/exists? libs-dir))
|
||||||
(is (fs/exists? libs-dir2))))))
|
(is (fs/exists? libs-dir2)))))
|
||||||
|
(testing "tokenization when called from tasks"
|
||||||
|
(is (= '{:port 5555, :accept clojure.core.server/repl}
|
||||||
|
(bb (pr-str '(-> (babashka.tasks/clojure {:out :string} "-J-Dfoo=\"{:port 5555 :accept clojure.core.server/repl}\" -M -e \"(clojure.edn/read-string (System/getProperty (name :foo)))\"") :out edn/read-string)))))))
|
||||||
|
|
||||||
(deftest ^:windows-only win-clojure-test
|
(deftest ^:windows-only win-clojure-test
|
||||||
(testing "GITLIBS can set location of .gitlibs dir"
|
(testing "GITLIBS can set location of .gitlibs dir"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue