diff --git a/CHANGELOG.md b/CHANGELOG.md index 4aa0e1ac..80d685f5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ A preview of the next release can be installed from ## Unreleased - [#1358](https://github.com/babashka/babashka/issues/1358): Expose a subset of java.lang.ref to enable hooking into the destruction/GC of objects +- [#1364](https://github.com/babashka/babashka/issues/1364): Be tolerant of unknown tags in `bb.edn` ## 0.9.162 (2022-09-04) diff --git a/sci b/sci index d0968cd7..22095a3a 160000 --- a/sci +++ b/sci @@ -1 +1 @@ -Subproject commit d0968cd7b3607b6106f81beb154806b450ddaf3e +Subproject commit 22095a3a741eef0ce6bb3efacad54f3f5bd24af8 diff --git a/src/babashka/main.clj b/src/babashka/main.clj index 0c0dda6c..e089b0f3 100644 --- a/src/babashka/main.clj +++ b/src/babashka/main.clj @@ -1040,8 +1040,8 @@ Use bb run --help to show this help output. (and (= minor-current minor-min) (>= patch-current patch-min))))))) -(defn load-edn [string] - (try (edn/read-string string) +(defn load-bb-edn [string] + (try (edn/read-string {:default tagged-literal} string) (catch java.lang.RuntimeException e (if (re-find #"No dispatch macro for: \"" (.getMessage e)) (throw (ex-info "Invalid regex literal found in EDN config, use re-pattern instead" {})) @@ -1060,7 +1060,7 @@ Use bb run --help to show this help output. bb-edn (when bb-edn-file (System/setProperty "babashka.config" bb-edn-file) (let [raw-string (slurp bb-edn-file) - edn (load-edn raw-string) + edn (load-bb-edn raw-string) edn (assoc edn :raw raw-string :file bb-edn-file) diff --git a/test/babashka/bb_edn_test.clj b/test/babashka/bb_edn_test.clj index 30a9bac2..589d72b7 100644 --- a/test/babashka/bb_edn_test.clj +++ b/test/babashka/bb_edn_test.clj @@ -445,3 +445,9 @@ even more stuff here\" (pr-str '{:paths ["test-resources"] :pods {pod/test-pod {:path "test-resources/pod"}}}) (is (= "42\n" (test-utils/bb nil "-m" "pod-tests.local"))))) + +(deftest tag-test + (test-utils/with-config + "{:deps {} + :aliases {:foo {:env-vars {:dude #env \"DUDE\"}}}}" + (is (= 6 (bb "-e" "(+ 1 2 3)")))))