2023-07-20 14:25:13 -04:00
|
|
|
#!/usr/bin/env bash
|
2021-10-01 12:47:10 -04:00
|
|
|
|
2023-01-31 10:03:37 -05:00
|
|
|
set -ex
|
2021-10-01 12:47:10 -04:00
|
|
|
|
|
|
|
GH_ARCH="amd64"
|
|
|
|
|
2023-07-20 14:25:13 -04:00
|
|
|
VERSION=$( curl --retry 12 --retry-delay 30 "https://api.github.com/repos/cli/cli/releases/latest" | grep '"tag_name"' | sed -E 's/.*"([^"]+)".*/\1/' | cut -c2- )
|
2021-10-01 12:47:10 -04:00
|
|
|
|
2023-01-31 11:13:55 -05:00
|
|
|
curl --retry 12 --retry-delay 120 -sSL "https://github.com/cli/cli/releases/download/v${VERSION}/gh_${VERSION}_linux_${GH_ARCH}.tar.gz" -o "gh_${VERSION}_linux_${GH_ARCH}.tar.gz"
|
2021-10-01 12:47:10 -04:00
|
|
|
|
|
|
|
tar xf "gh_${VERSION}_linux_${GH_ARCH}.tar.gz"
|
|
|
|
|
|
|
|
cp "gh_${VERSION}_linux_${GH_ARCH}/bin/gh" /usr/local/bin/
|
|
|
|
|
|
|
|
gh --version
|