This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-03-11
Channels
- # announcements (15)
- # aws (11)
- # babashka (13)
- # babashka-sci-dev (2)
- # beginners (63)
- # calva (20)
- # cider (9)
- # clj-kondo (27)
- # clojars (3)
- # clojure (34)
- # clojure-art (4)
- # clojure-europe (21)
- # clojure-filipino (1)
- # clojure-indonesia (1)
- # clojure-my (1)
- # clojure-nl (11)
- # clojure-norway (10)
- # clojure-sg (1)
- # clojure-spec (4)
- # clojure-uk (4)
- # clojurescript (5)
- # cursive (8)
- # deps-new (2)
- # events (1)
- # exercism (2)
- # fulcro (44)
- # graphql (6)
- # gratitude (1)
- # introduce-yourself (1)
- # jobs (3)
- # leiningen (5)
- # lsp (26)
- # membrane (18)
- # missionary (9)
- # off-topic (1)
- # pedestal (5)
- # portal (1)
- # quil (24)
- # re-frame (17)
- # reagent (5)
- # remote-jobs (2)
- # reveal (3)
- # spacemacs (4)
- # tools-build (1)
- # tools-deps (12)
Hey there, I'm trying to output a string of edn to stdout via clj -T...
and for some reason I can't get the namespace to load. I feel like there's something simple I'm missing. Can anyone spot it?
deps.edn aliases
:aliases {:jib-config {:replace-paths ["dev/tools"]
:exec-fn tools.skaffold/get-skaff-config}}
<project-root>/dev/tools/skaffold.clj
(ns tools.skaffold)
(defn get-skaff-config [_]
(with-out-str (clojure.pprint/pprint {:x 1 :y -1})))
Output
❯ clj -T:jib-config
Namespace could not be loaded: tools.skaffold
-X yields the same results
❯ clj -X:jib-config
Namespace could not be loaded: tools.skaffold
you want :replace-paths ["dev"]
the namespace (tools.skaffold) is relative to the path (dev) - those get put together
I also have dev/user.clj
which takes sometime to load and has some extra stdout, which is why I was trying to avoid it.
yes, that's how the JVM classpath works
you could put one of these things under another root of course
namespace is munged into a resource path, then that resource path is checked relative to each classpath location
tools.skaffold => tools/skaffold.clj => look for that in dev/ (and other locations)