Thanks @borkdude the usage looks very nice; I am not very familiar with Babashka though so how do I use this script? I place it in a folder somewhere or need to execute the script on the commandline before I can use it?
@flyingpython You must install babashka first e.g. using #scoop
And then you can execute the script with bb new.clj
if you want to execute it globally you can make a .bat
script out of it with this "shebang":
https://github.com/borkdude/deps.clj/blob/master/deps.bat#L1-L7
so you can then rename it to new.bat
and place it somewhere on your path
and then you can run C:\Foo> new
anywhere
OK thanks borkdude, I have some great options now to make these templates pain-free 🙂
I fail to get clojure to work. ps1 module or scoop, I get the same result. Installation seems to get done, but running clj
I get
Error: Could not find or load main class clojure.main
Anyone recognize this?(Tried all three installation options for the PS module.)
@pez Just checking: are you sure you didn’t have a clj
script on your path before, i.e., a non-official clj
?
(what does running clojure
produce?)
Running clojure
produces:
Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main
It is a completely fresh Windows install. The PC arrived yesterday. No clj
there before, I am pretty sure.what does clojure --version
produce
Clojure CLI version 1.10.3.822
that looks good
is this still with your user with the space in it?
Yes, that user.
might be related? try a user without space?
Doing it.
But it won’t help me, because I need it t work with the user with space in order to have the environment where the thing I am investigating happens.
yes, but narrowing down the issue helps probably?
Oh, yes, I said, I’m doing it. 😃
does this mean: it works, or I'm going to try? just trying to narrow down the meaning ;)
It means I’m trying with the non-space user.
clojure
works then.
ok, so now we need to figure out if it's the powershell script or something in tools.deps or both
if it's in tools.deps, this might explain why you get it with both the official clojure and deps.clj
lein works in both environments
yeah, but lein doesn't use tools.deps
I’m just sayin’ 😃
the error sounds like it is a bad command to Java, which leads me to strongly suspect something in the powershell
cmd-clj has the same problem. But that doesn’t mean it is not something in the powershell of course.
fwiw there is a similar error in deps.clj (the unofficial one) but we still haven't nailed it down. I can't reproduce it with a Windows user with a space
what is cmd-clj?
fyi cmd-clj and cmd-clojure are scoop shims that launch clojure from the cmd.exe, they still require powershell, but don't expect powershell as a initial prompt.
I would recommend to avoid them at all costs 🙂
[[
"powershell.exe",
"cmd-clojure",
"-NoProfile -ExecutionPolicy Bypass -Command Invoke-Clojure"
],
[
"powershell.exe",
"cmd-clj",
"-NoProfile -ExecutionPolicy Bypass -Command Invoke-Clojure"
]]
This is a prescription for those two shimsnot sure if like this needs some escaping around $ToolsCp ?
& $JavaCmd -classpath $ToolsCp clojure.main -m clojure.tools.deps.alpha.script.make-classpath2 --config-user $ConfigUser --config-project $ConfigProject --basis-file $BasisFile --libs-file $LibsFile --cp-file $CpFile --jvm-file $JvmFile --main-file $MainFile @ToolsArgs
or even in $JavaCmd
or well... all of those file args
The deps.clj problem is what I am trying to nail down. But running deps.clj in dev with lein just gives me a sweet Clojure prompt…
@pez what if you execute the deps.bat
script?
and are you on the master branch?
Yes, on master branch. Will try the deps.bat scrit now.
deps.bat
gives me back the shell prompt after a short delay. Nothing else.
@alexmiller, I’m not following about the escaping.
For context: On some windows machines deps.clj
fails if the user’s home directory has spaces in it. I bought a PC to try investigate it and had some luck there because it happens on that PC. It does not happen on @borkdude’s machine, using the same user name as I am trying with. When trying to narrow it down I want to run deps.clj in dev, and then ran into this problem with not being able to run clojure
. Both deps.clj
and clojure
works on the machine for a username w/o spaces in it.
> what is cmd-clj?
It’s a command installed together with clojure
and clj
for running clj
from cmd.exe
.
@pez any luck with deps.bat
?
It just returns the PS prompt.
how are you running it?
@pez it needs babashka to run. does bb
work in your PS?