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/ubuntu/install-yq

19 lines
347 B
Bash

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