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.
23 lines
441 B
Plaintext
23 lines
441 B
Plaintext
2 years ago
|
#!/bin/sh
|
||
|
set -e
|
||
|
|
||
|
cd "$(mktemp -d)"
|
||
|
|
||
|
# TODO eventually update this to detect
|
||
|
os=mac
|
||
|
arch=amd64
|
||
|
|
||
|
file=$(curl -sSL "https://golang.org/dl/?mode=json" \
|
||
|
| jq -r '.[0].files[]
|
||
|
| select(.os == "'"$os"'")
|
||
|
| select(.arch == "'"$arch"'")
|
||
|
| .filename')
|
||
|
|
||
|
curl -sSLO \
|
||
|
-H "Accept: application/vnd.github.v3+json" \
|
||
|
"https://dl.google.com/go/$file"
|
||
|
|
||
|
sudo tar xzf "$file" -C /usr/local/
|
||
|
|
||
|
echo "Make sure /usr/local/go/bin is in PATH"
|