mirror of https://github.com/rwxrob/dot
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.
22 lines
460 B
Bash
22 lines
460 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
user=rwxrob
|
|
name=keg
|
|
target=~/.local/bin
|
|
|
|
arch=$(uname -m)
|
|
[ "$arch" = x86_64 ] && arch=amd64
|
|
|
|
latest="https://api.github.com/repos/$user/$name/releases/latest"
|
|
ver=$(curl -sS "$latest" | jq -r .zipball_url) && test -n "$ver"
|
|
ver=${ver##*/}
|
|
ver=${ver#v}
|
|
exe="${name}-linux-${arch}"
|
|
url="https://github.com/$user/$name/releases/download/v${ver}/$exe"
|
|
mkdir -p "$target" || true
|
|
cd "$target"
|
|
curl -LO "$url"
|
|
chmod ug+x "$exe"
|
|
mv "$exe" "$name"
|