Fork me on GitHub
#babashka
<
2021-04-05
>
az03:04:45

Hi all, any ideas on how I would get this to work using clojure.java.shell? I’ve tried all the variations I can think of but can’t get the > working

pg_dump -Fc  > dump.sql

borkdude07:04:46

@limix > is bash syntax, so prepend this with "bash" "-c"

borkdude07:04:52

@limix you can also use babashka.process which accepts :out <file>

$ bb -e '(babashka.process/sh ["echo" "foo"] {:out (io/file "/tmp/output.txt")})'

az15:04:48

@U04V15CAJ Thanks so much for the reply!

mmz11:04:56

What's your preferred way of visualising graphs with babashka? I'm looking for a simple way to visualise graphs based on data retrieved and transformed in babashka.

mmz11:04:48

(simple line graphs and histograms probably fit 95% of the use cases)

borkdude11:04:38

Ah not graphs as in directed, acyclic graphs, but graphs as in images?

borkdude11:04:49

Here is an example of someone using vega-lite to do it. https://gist.github.com/vdikan/6b6063d6e1b00a3cd79bc7b3ce3853d6/ It's using the old custom "from scratch" http server, but nowadays you can do this using httpkit. The html could now be done using hiccup.

1
mmz16:04:28

Thank you! That should work :thumbsup::skin-tone-3:

grazfather15:04:09

Check out #data-science

1
borkdude20:04:11

@grazfather fyi, I'm now experimenting with topological sort and dependencies between tasks: https://github.com/babashka/babashka/discussions/765#discussioncomment-571737

grazfather20:04:04

is your intent mostly to work with .PHONY like targets, or would you support something that can detect if a task actually needs to run?

grazfather20:04:18

e.g. if test needs bin, but bin doesn’t run if none of the files have been touched

grazfather20:04:40

technicall a task could have an attribute that is a ‘needs to run’ predicate

borkdude20:04:58

@grazfather yes, can easily support that, but you can also write (when ... ...) or (if ... (println "Nothing to do here") yourself

grazfather20:04:35

true, that’s probably a better idea. Just maybe something for the babashka book (a recipe) rather than baking it into bb itelsf

borkdude20:04:46

can always add it later, if it turns out to be something people really want, but providing some helper functions like (modified-since? target files) are the foundation I think

👍 1
borkdude20:04:31

Borrowing ideas from https://github.com/juxt/mach, but leaving some things out which I think you can do yourself in some code, which could be added later into some option as well

grazfather20:04:15

oh, I have never seen that project

borkdude20:04:14

it's deprecated

borkdude20:04:57

if you want to play with this, binaries available in #babashka-circleci-builds

grazfather22:04:55

I might 🙂 I often whip up quick makefiles when I am debugging something just to re do a few steps

grazfather22:04:03

often in a docker container

grazfather22:04:34

An easy (if docker ps | grep) to avoid re-starting the container would be awesome