Hereβs a relevant ongoing discussion (see comments in that thread).
Ok I've created a new project using the https://github.com/seancorfield/deps-new/ however when I try to run anything using deps -X I get: No function found on command line or in :exec-fn
here's the deps.edn I have:
{:paths ["src" "resources"]
:deps {org.clojure/clojure {:mvn/version "1.10.3"}}
:aliases
{:run-m {:main-opts ["-m" "depsapp.core"]}
:run-x {:ns-default depsapp.core
:exec-fn greet
:exec-args {:name "Clojure"}}
:build {:deps {io.github.seancorfield/build-clj
{:git/tag "v0.6.3" :git/sha "9b8e09b"
;; since we're building an app uberjar, we do not
;; need deps-deploy for deployment:
:deps/root "slim"}}
:ns-default build}
:test {:extra-paths ["test"]
:extra-deps {org.clojure/test.check {:mvn/version "1.1.1"}
io.github.cognitect-labs/test-runner
{:git/tag "v0.5.0" :git/sha "48c3c67"}}}}}
now I'm running f.e deps -X:run-m`` and get
No function found on command line or in :exec-fn``
any idea ?
You need run-x there probably
yes you are right thank you
i'm running deps.exe and getting a repl in the user namespace. is there a way to define the namespace before starting ?
@spapas You can do -i init.clj with some initialization code
echo '(ns dude) (clojure.main/repl)' > /tmp/init.clj
clj -M -i /tmp/init.clj
dude=>@borkdude thank you!
i've written a post: https://www.spapas.net/2022/04/14/clojure-windows/ if you wanna take a look
i've posted it on #beginners, shall i post it anywhere else ?
#news-and-articles is the channel for sharing posts
good post, that's really helpful for beginners
thank you
One piece of feedback: > To be able to create a new project youβll need to use the https://github.com/seancorfield/deps-new project. I hardly use any such tool, I create my projects usually from scratch. I've also written a small #babashka script to add stuff to existing projects, like dependencies: https://github.com/babashka/neil
you mean you create your project by creating the required folders and deps.edn by hand ?
yes
clj-new / deps-new are convenient but manually it's not too hard to setup a project either
yes you are right i'll rephrase that a bit
it's just that for a newbie it's easier (and faster) to create the project skeleton through a tool instead of by hand
agreed
I added an answer https://ask.clojure.org/index.php/11767/how-can-we-make-it-easier-for-beginners-to-install-clojure?show=11773#a11773 I hope you find it helpful
@spapas deps.clj does not require you to install powershell
yes i know it however it's not mentioned at all on the getting started guide for windows usesr
so how a new user is supposed to know about it ?
also, there's no mention about how to create a new project there!
i had to ask here to learn about f.e https://github.com/seancorfield/deps-new
well, maybe add it?
i can't take that decision myself
if it's not there maybe there are reasons for not being there
I don't think anything will change on the windows side unless people will pro-actively report issues and submit PRs
yes you are right i guess ... where could I report an issue with these docs ?
@spapas https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows is a wiki page on GitHub that anyone can edit I think?
(I have "Contrib" permission as a maintainer so I don't know if that wiki is restricted)
Seems that I can edit it. I'll try to add some tips for new users from my experience
Hey @borkdude @seancorfield I've installed deps.exe (deps.clj - https://github.com/borkdude/deps.clj ) on my windows system and it seems to be working (i get a clojure rpl when I run deps). now I want to install deps.new (https://github.com/seancorfield/deps-new) to be able to create a new project.
I tried this command for starters (to avoid the quoting problems): deps -Ttools install io.github.seancorfield/deps-new :as new and got: Key is missing value: new
I also tried various other combinations i.e deps -Ttools install io.github.seancorfield/deps-new '{:git/tag "v0.4.9"}' :as new or deps -Ttools install io.github.seancorfield/deps-new '{:git/tag """v0.4.9"""}' :as new but always got the same error (Key is missing value: new
when I run -Ttools install without parameters I get:
deps -Ttools install
Execution error (ExceptionInfo) at clojure.tools.tools.api/install (api.clj:37).
Missing required args, syntax: clj -Ttools lib-name coord :as tool-name
any help would be welcome, thank you !
You are executing this from cmd.exe right?
yes of course
i only use cmd.exe i hate powershell
afaik cmd.exe doesn't support single quote for delimiting strings on the command line
ok but shouldn't this thingie deps -Ttools install io.github.seancorfield/deps-new :as new work ?
I think so. I'm not near a Windows machine today (travelling) but I can try tomorrow
thank you
can you explain me what "coord" is ? from this message: Missing required args, syntax: clj -Ttools lib-name coord :as tool-name
is there a way to pass a coord in cmd.exe ?
coord is something like :mvn/version "1.0.0"
hey i made it work !
here's the command: deps -Ttools install io.github.seancorfield/deps-new "{:git/tag """v0.4.9"""}" :as new
See https://clojure.org/reference/deps_and_cli#_tool_installation
you helped my by pointing out that the ' aint' working in cmd.exe π
thanks
yey deps -Tnew app :name spapas/newapp succeeds!
now if i visit my newapp folder and run deps.exe i'll get a repl on my app ?
I wish there was a way to omit those quotes on the command line. It would cause less confusion between OSSes. This issue is about that. If you agree, please upvote it: https://ask.clojure.org/index.php/11585/consider-convention-for-bypassing-edn-parsing-in-x-usage /cc @alexmiller
Although in this case you would likely still need quotes since the coordinate map should be handled as one whole thing.
There is also a wiki where you can add helpful info about working on Windows: https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows
Yes I'll try; but will my changes be reviewed by somebody? I don't know what's the policy for writing stuff
Good question, maybe Alex can respond to that.
I could write a small article on my blog instead (https://www.spapas.net/) ?
for sure!
cool I'll do that to be sure that I express my opinions π thanks