This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-01-28
Channels
- # announcements (4)
- # aws (2)
- # babashka (56)
- # beginners (43)
- # calva (70)
- # clj-kondo (25)
- # cljs-dev (29)
- # clojure (103)
- # clojure-dev (9)
- # clojure-europe (55)
- # clojure-gamedev (8)
- # clojure-nl (5)
- # clojure-norway (5)
- # clojure-uk (4)
- # clojured (1)
- # clojurescript (56)
- # copenhagen-clojurians (1)
- # core-async (2)
- # cursive (16)
- # datomic (5)
- # deps-new (18)
- # emacs (9)
- # events (3)
- # fulcro (45)
- # graphql (2)
- # gratitude (2)
- # kaocha (6)
- # lambdaisland (8)
- # lsp (72)
- # meander (41)
- # missionary (5)
- # nextjournal (52)
- # off-topic (2)
- # pathom (12)
- # pedestal (2)
- # practicalli (1)
- # re-frame (6)
- # reitit (5)
- # releases (1)
- # reveal (1)
- # specter (3)
- # sql (4)
- # tools-deps (22)
- # vim (8)
- # wasm (1)
- # xtdb (22)
Is there a way to force clojure -Spath
to return absolute paths even for project paths like str:test
?
No - what problem are you trying to solve?
one more thing: will Clojure always treat the deps.edn in the current directory the Project source or is there a way to override that? like clojure -Spath -depsedn=./subfolder/deps.edn
?
@U08BJGV6E If you don't mind omitting the user deps.edn
, you could point the CLJ_CONFIG
env var at the subfolder and clojure
would treat that as your user deps.edn
instead. It would still then also include the project deps.edn
however.
You could also do -Sdeps '{:deps {subfolder/code {:local/root "subfolder"}}}' -Spath
which would give you a combined classpath of that subfolder and the project deps.edn
files.
Thank you I figured it is actually easier to just go (cd subfolder && clojure -Spath )
instead
If you want "multiple clojure projects in subfolders", the :local/root
deps might be the way to go there? If you only want one subfolder, then cd
is definitely easier.
but does carry the caveats of considering any deps.edn in the cwd - my intention is to examine projects in multiple subfolders in isolation
Another trick:
clojure -Spath -Sdeps '{:deps {current/deps {:local/root "."}}}'
and strip the leading relative directories@U2J4FRT2T thank you, a version of that is what I ended up arriving at!
Slightly longer version :)
clj -Spath | bb '(as-> *in* $ (slurp $) (str/trim $) (str/split $ #":") (map fs/real-path $) (str/join ":" $))'
find . -name deps.edn \
| while read p
do
dirname "$p"
done \
| while read dp
do
realpath "$dp"
done \
| sort \
| while read dp
do
( cd "$dp" && clojure -Spath -Sforce -Srepro \
| tr ":" "\n" \
| while read p
do
realpath "$p"
done
)
done \
| sort \
| uniq \
| tr "\n" ":"
> merge classpaths from multiple clojure projects in subfolders It feels like I’ve seen this request a few times in the last months, spread over different channels. Would it make sense to build some version of it into the cli?