Fork me on GitHub
#clojure-europe
<
2021-05-05
>
dharrigan05:05:30

Good Morning!

slipset06:05:31

Almost snowing here in Oslo this morning.

😱 3
orestis08:05:00

I have a bunch of very very common project-related command lines that I run all the time. Things like start a remote REPL etc etc. I don't want to commit those to git because they're relevant only to my setup. Is this something that babashka tasks would be useful somehow?

borkdude08:05:04

@orestis babashka tasks is more like a replacement for makefiles than let's say global bash aliases

borkdude08:05:15

maybe you just need that, a global bash alias

orestis08:05:32

I use fish but yeah, global aliases make sense.

borkdude08:05:49

I use the term "bash" in the broadest sense possible

😂 9
orestis08:05:22

My laziness (and part of the reason I use fish) will still probably hit up arrow 10 times 😄

slipset08:05:05

C-r might just be your friend, as could !start-of-command

borkdude08:05:34

Maybe babashka tasks could also support global tasks :thinking_face:

slipset08:05:59

bash has implemented readline which can be set to understand Emacs or Vi bindings, and in emacs, C-r is incremental search backwards.

slipset08:05:14

Not sure about fish, though.

slipset08:05:08

The ways in which you can search/manipulate the command line is quite interesting.

orestis08:05:19

Fish allows you to type the start of the command and press up arrow.

mdallastella08:05:49

On fish you write some characters and then you can: use C-r for search backwards or simply press the up arrow.

borkdude08:05:56

I have thought about global bb tasks, but the problem there might be: - bb tasks are now project/directory specific and they can depend on each other like in make - if we could merge tasks from the home directory, this could result in a weird mix of global and local dependencies? and broken tasks in CI if you forget that something is coming from your home dir?

borkdude08:05:55

this is why a shell alias probably makes most sense?

borkdude08:05:01

or just a script in your bin dir

orestis08:05:17

Can I point bb to a specific tasks file? Or does it always default to the working directory? I could think of a global alias that invokes bb tasks on my home dir.

orestis08:05:37

I like bb tasks mainly for the memory help: afaik, if you invoke it with no args it will show you the available tasks.

borkdude08:05:38

@orestis You can with BABASHKA_EDN=other/bb.edn bb foo

borkdude08:05:47

(I used this mostly for testing)

borkdude08:05:59

Maybe I should just allow bb global tasks and if people depend on their home tasks in a project, they should just deal with it themselves?

borkdude08:05:12

@orestis Let me experiment with global tasks. Are you willing to test a version when I have one?

genRaiy09:05:26

I considered using babashka tasks for building cljs and running a clj server but in the end clj -A:build-client && clj -A:serve is simpler ... is there a 5 task rule?

borkdude09:05:00

One of the points of tasks is that clj -A:build-client && clj -A:serve is something you have to remember. With bb tasks you get an overview of tasks + descriptions. So after a month or two when you come back to this project, you see:

$ bb tasks
The following tasks are available:

serve Builds CLJS sources and launches server
instead of reading through your deps.edn trying to find out what are the valid combinations of aliases, main fns and exec fns. For this reason people often make Makefiles or shell scripts, but now you can do it with bb as well.

😍 6
borkdude09:05:07

btw @raymcdermott the #defnpodcast is really picking up steam again, I'm happy to see this

genRaiy09:05:09

Thanks @borkdude - New episode today too!

aw_yeah 3
borkdude09:05:23

(yeah, that's what triggered me to say this :))

😂 3
borkdude09:05:43

Really a big fan. Please share to #podcasts too

orestis10:05:45

@borkdude wow I didn't expect this to turn into a proper project for you! I have to confess I don't even have babashka installed ATM 🙂 I'm keeping my eye on it and continuously assessing the various usefulness, but sitting down and a) making it required installation for devs and CI and b) actually going through our existing bash scripts to convert them isn't high on my priorities right now.

orestis10:05:52

As far as my original question was, pointing to a dedicated bb.edn file is exactly what I want. I can then deal with the fallout myself e.g. if I need to use local directories or relative to the bb.edn file etc I can do that...

borkdude10:05:51

Sorry for pulling you into the #babashka channel btw, feel free to leave, I won't be offended in any way ;)

orestis11:05:19

No worries 🙂