Fix #1661: follow symlink

This commit is contained in:
Michiel Borkent 2024-01-29 12:15:43 +01:00
parent 35e17bd46a
commit b0ce680fda

View file

@ -1162,7 +1162,8 @@ Use bb run --help to show this help output.
jar (some-> [jar] cp/new-loader (cp/resource "META-INF/bb.edn") .toString) jar (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 [rel-bb-edn (fs/file (fs/parent file) "bb.edn")] (let [file (fs/real-path file) ;; follow symlink
rel-bb-edn (fs/file (fs/parent file) "bb.edn")]
(if (fs/exists? rel-bb-edn) (if (fs/exists? rel-bb-edn)
(abs-path rel-bb-edn) (abs-path rel-bb-edn)
;; fall back to local bb.edn ;; fall back to local bb.edn