You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rwxrob-dot/install/mac/install-keg

21 lines
362 B
Bash

#!/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