vscodium/install_gh.sh

16 lines
501 B
Bash
Raw Normal View History

2021-10-01 19:47:10 +03:00
#!/bin/bash
2023-01-31 18:03:37 +03:00
set -ex
2021-10-01 19:47:10 +03:00
GH_ARCH="amd64"
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 19:47:10 +03: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 19:47:10 +03:00
tar xf "gh_${VERSION}_linux_${GH_ARCH}.tar.gz"
cp "gh_${VERSION}_linux_${GH_ARCH}/bin/gh" /usr/local/bin/
gh --version