mirror of
https://github.com/mr0xb/scripts.git
synced 2026-08-27 19:34:57 -04:00
18 lines
347 B
Shell
Executable file
18 lines
347 B
Shell
Executable file
#!/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
|