Fix #1818: wrong argument order in clojure.java.io/resource (#1819)

* Fix #1818: wrong argument order in clojure.java.io/resource

* fix
This commit is contained in:
Michiel Borkent 2025-05-13 11:28:44 +02:00 committed by GitHub
parent 238a98d9b2
commit 8052618fa8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 3 deletions

View file

@ -9,6 +9,7 @@ A preview of the next release can be installed from
## Unreleased ## Unreleased
- [#1818](https://github.com/babashka/babashka/issues/1818): wrong argument order in `clojure.java.io/resource` implementation
- Add `java.text.BreakIterator` - Add `java.text.BreakIterator`
- Bump `fs` to `0.5.25` - Bump `fs` to `0.5.25`
- Bump `jsoup` to `1.20.1` - Bump `jsoup` to `1.20.1`

View file

@ -84,8 +84,8 @@
cp))) cp)))
(defn resource (defn resource
(^URL [path] (resource @the-url-loader path)) (^URL [path] (resource path @the-url-loader))
(^URL [loader path] (^URL [path loader]
(if (str/starts-with? path "/") nil ;; non-relative paths always return nil (if (str/starts-with? path "/") nil ;; non-relative paths always return nil
(getResource loader [path] true)))) (getResource loader [path] true))))

View file

@ -1190,7 +1190,7 @@ Use bb run --help to show this help output.
(println "[babashka] WARNING: config file does not exist:" config)) (println "[babashka] WARNING: config file does not exist:" config))
nil)) nil))
jar (let [jar (resolve-symbolic-link jar)] jar (let [jar (resolve-symbolic-link jar)]
(some-> [jar] cp/new-loader (cp/resource "META-INF/bb.edn") .toString)) (some->> [jar] cp/new-loader (cp/resource "META-INF/bb.edn") .toString))
:else (if (and file (fs/exists? file)) :else (if (and file (fs/exists? file))
;; file relative to bb.edn ;; file relative to bb.edn
(let [file (abs-path file) ;; follow symlink (let [file (abs-path file) ;; follow symlink