rwxrob-dot/install/mac/install-keg
2023-10-05 10:29:34 -04:00

21 lines
362 B
Bash
Executable File

#!/bin/sh
url="https://github.com/rwxrob/keg/releases/latest/download/keg-darwin-amd64"
exe=keg
dir=$(mktemp -d)
cleanup () {
rm -rf "$dir"
}
trap cleanup EXIT
curl -L "$url" -o "$dir/$exe"
chmod +x "$dir/$exe"
# mkdir -p is not POSIX compliant
[ ! -d ~/.local ] && mkdir ~/.local
[ ! -d ~/.local/bin ] && mkdir ~/.local/bin
cp "$dir/$exe" ~/.local/bin