This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-14
Channels
- # aleph (2)
- # atlanta-clojurians (5)
- # beginners (38)
- # boot (2)
- # bristol-clojurians (1)
- # cider (31)
- # clara (8)
- # cljs-dev (136)
- # cljsrn (4)
- # clojure (86)
- # clojure-china (1)
- # clojure-greece (1)
- # clojure-italy (24)
- # clojure-nl (1)
- # clojure-spec (21)
- # clojure-uk (19)
- # clojurescript (68)
- # community-development (28)
- # core-async (35)
- # core-logic (4)
- # cursive (1)
- # data-science (1)
- # datascript (1)
- # datomic (46)
- # events (1)
- # figwheel (6)
- # fulcro (11)
- # graphql (3)
- # hoplon (1)
- # jobs (6)
- # jobs-discuss (94)
- # keechma (3)
- # luminus (4)
- # lumo (7)
- # mount (6)
- # off-topic (24)
- # onyx (6)
- # parinfer (31)
- # portkey (3)
- # programming-beginners (16)
- # re-frame (20)
- # reagent (69)
- # remote-jobs (4)
- # ring-swagger (25)
- # schema (1)
- # shadow-cljs (151)
- # spacemacs (2)
- # sql (14)
- # tools-deps (16)
- # uncomplicate (5)
- # unrepl (35)
- # vim (1)
- # yada (72)
My thinking was that it’s nice because it doesn’t depend on how a particular thing handles command line args?
I want to get these types of things working, and I think I’ve tried quoting and escaping the things after clj
in all ways possible, but I bet there is a way I haven’t tried, since I can’t get it to work:
#!/usr/bin/env clj -Sdeps '{:deps {clj-time {:mvn/version "0.14.2"}}}'
(require '[clj-time.core :as t])
(println (str "Time is now " (t/now)))
I either get a "Error building classpath. Don't know how to create ISeq from: clojure.lang.Symbol"
or a "Error while parsing option "--config-data {:deps": java.lang.RuntimeException: EOF while reading"
for a combinations that I’ve tried. I bet someone knows how to do this properly?@niclasnilsson what OS are you on? That won't work for Linux.
Do you mean like “there is no way to make it work”?
There's a limitation on how shebangs are read. It doesn't apply to mac though.
You may find it works if you don't use env
Ah, ok. Will try again then. Thanks!
Also: try using ,
instead of space in the deps string.
@seancorfield Yes, I think you might have the right of it there. '
doesn't have have the same effect in shebangs as on the shell.
Confirmed that the following works @niclasnilsson
(! 622)-> ./time.sh
Time is now 2018-03-14T17:09:15.652Z
Wed Mar 14 10:09:15
(sean)-(jobs:0)-(~/clojure/bin)
(! 623)-> cat time.sh
#!/usr/bin/env clj -Sdeps {:deps,{clj-time,{:mvn/version,"0.14.2"}}}
(require '[clj-time.core :as t])
(println (str "Time is now " (t/now)))
On macOSfootnote to "On macOS" https://unix.stackexchange.com/questions/63979/shebang-line-with-usr-bin-env-command-argument-fails-on-linux
Ah… I wasn’t even close to try that combination. Neat, thanks, @seancorfield!
Will try myself later tonight, when I get back to this.