Good Morning!
👋
Almost snowing here in Oslo this morning.
morning
Good morning.
Morning
Morning
Morning
Morning!
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?
@orestis babashka tasks is more like a replacement for makefiles than let's say global bash aliases
maybe you just need that, a global bash alias
I use fish but yeah, global aliases make sense.
I use the term "bash" in the broadest sense possible
My laziness (and part of the reason I use fish) will still probably hit up arrow 10 times 😄
C-r
might just be your friend, as could !start-of-command
Maybe babashka tasks could also support global tasks :thinking_face:
bash has implemented readline which can be set to understand Emacs or Vi bindings, and in emacs, C-r
is incremental search backwards.
Not sure about fish, though.
The ways in which you can search/manipulate the command line is quite interesting.
Fish allows you to type the start of the command and press up arrow.
On fish you write some characters and then you can: use C-r
for search backwards or simply press the up arrow.
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?
this is why a shell alias probably makes most sense?
or just a script in your bin dir
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.
I like bb tasks mainly for the memory help: afaik, if you invoke it with no args it will show you the available tasks.
@orestis You can with BABASHKA_EDN=other/bb.edn bb foo
(I used this mostly for testing)
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?
morning
@orestis Let me experiment with global tasks. Are you willing to test a version when I have one?
morning
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?
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.btw @raymcdermott the #defnpodcast is really picking up steam again, I'm happy to see this
Thanks @borkdude - New episode today too!
(yeah, that's what triggered me to say this :))
Really a big fan. Please share to #podcasts too
@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.
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...
Sorry for pulling you into the #babashka channel btw, feel free to leave, I won't be offended in any way ;)
No worries 🙂