Fork me on GitHub
Jonathan D Johnston01:07:31

This might be too off-topic for the Babashka Book, but I have a simple alternative to your clever "beside" .bat for Windows. I can run any in PATH by simply typing script. To do so, I FTYPEd .bb as something like (name doesn't matter) bbscript, ASSOCed bbscript with the abspath to bb.exe, and added .BB to the PATHEXT environment variable. Not as clean as #!, but it works. CAVEAT: I've never tried this on anything newer than Windows 7

Jonathan D Johnston01:07:51

Oops, I got ASSOC & FTYPE backwards. Sorry. Also, I probably needed Administrator privileges to make it persistent. If that's not a showstopper, it's a handy option, especially for polyglot programmers


Perhaps you can make a full standalone example of what you are saying, e.g. as a gist or so? Please use threads when posting messages about the same topic. Thanks

Jonathan D Johnston17:07:21

@U04V15CAJ I hope explains better what I was trying to suggest. Sorry about the non-threading.


@UH7SJ6UKG This is very cool, thanks for sharing!

Jonathan D Johnston18:07:54

@U04V15CAJ Glad you found it of interest! :)

Adham Omran07:07:46

I have an issue when using shell to run a cp command Minimal example

 {copy (shell "cp -r ./dir/* .")}}
This is my ls -la
drwxr-xr-x 5 adham users  4096 Jul  9 10:11 .
drwxr-xr-x 6 adham users  4096 Jun 24 11:36 ..
-rw-r--r-- 1 adham users   585 Jul  9 10:10 bb.edn
drwxr-xr-x 2 adham users  4096 Jul  9 10:11 dir
-rw-r--r-- 1 adham users    10 Jun 13 10:26 .envrc
-rw-r--r-- 1 adham users   564 Jun 13 10:26 flake.lock
-rw-r--r-- 1 adham users  1066 Jun 13 10:26 flake.nix
drwxr-xr-x 8 adham users  4096 Jul  9 10:10 .git
-rw-r--r-- 1 adham users   319 Jul  9 10:07 .gitignore
-rw-r--r-- 1 adham users 35149 Jul  9 09:27 LICENSE
-rw-r--r-- 1 adham users  1587 Jul  9 09:46
The error I get is
cp: cannot stat './dir/*': No such file or directory
Error while executing task: copy
Running cp -r ./dir/* . works as intended.


shell shells out to programs, it isn't running a bash command


if you want to run bash, you should call bash like:

(shell "bash" "-c" "cp -r ...")


You can also use babashka.fs to copy files

Adham Omran07:07:23

I see, thank you!

Adham Omran07:07:12

Thanks to babashka this

Tomas Brejla09:07:26

@U03QTHYKXK7 perhaps you even no longer need that leading paragraph to contain link to deps-new after the cleanup? (unless it's important and the people using that training should be aware of deps-new being used internally by the setup task)

Adham Omran08:07:22

Hey @U01LFP3LA6P, thank you for the note is meant to on-board people new to Clojure for a training so I put the note in case they come across Leiningen at some point later to understand how we made the projects

👍 1