Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Script that downloads Babashka if not available and runs the file as a Babashka script afterwards
#!/usr/bin/env bash
if [ ! -x "$bb_dir/bb" ]; then
echo "Babashka not found. Installing it at $bb_dir directory..."
download_dir="$(mktemp -d)"
trap "rm -rf $download_dir" EXIT
curl "" -Ssqlo "$download_dir/install"
mkdir -p "$bb_dir"
bash "$download_dir/install" --dir "$bb_dir" --static
exec "$bb_dir/bb" -f "$0" -- "$@"
(println "Hello World!")

This comment has been minimized.

Copy link

@verma verma commented May 28, 2021

Very nice, thanks for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment