Fork me on GitHub

i take it babshka curl doesn't have the equivalent of body-params? whats the simplist clojure to body method? clj -> json -> str?


oh cheshire is included

👍 3

this is gonna be great. I knew procrastinating about learning bash was going to pay off

😆 12
clj 4

Hi! I find myself turning again and again to babashka because life is indeed too short to remember how to parse command line options properly in bash. It's extremely powerful and flexible. I have two questions about the library: 1. Is there an accepted method of piping the result of a babashka script back to the current shell? I've used something like $ bb -o parse_cli_opts.clj -f -o some_option arg1 arg2 arg3 | source /dev/stdin to do validation of inputs for a bash script that ultimately needs to run in the current shell because of what's on the $PATH, the CLI it uses, etc. The drawback of this approach is that piping to source /dev/stdin/ doesn't allow for TTY/interactive programs to pick up the command because source isn't a TTY (my specific use case here is docker run -it, but there are other potential examples). 2. Following existing bash conventions, are there plans to add something like .bbrc or .bb_profile where you can have a series of babashka functions and scripts in a file and they're available for system-wide invocation?


@afoltzm 1. piping back to the current shell, not sure what you mean there. the -o option can be used to pipe the output to another text-lines command line tool 2. that's what the BABASHKA_PRELOADS environment variable is for. Check docs.