Skip to content

Commit

Permalink
Add github cli install script
Browse files Browse the repository at this point in the history
Work around of cli/cli#6175
  • Loading branch information
mtaron committed Sep 4, 2022
1 parent ccfccac commit 91e69c0
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions home/private_dot_config/private_zsh/zsh.d/install.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,21 @@ install-kitty()

ln --symbolic --force "$destination"/bin/kitty "$XDG_BIN_DIR"/kitty
}

# Temporary workaround for https://github.com/cli/cli/issues/6175
install-gh()
{
tmp_dir=$(mktemp --directory)

download_url=$(
curl --silent --location --show-error --fail https://api.github.com/repos/cli/cli/releases/latest \
| jq -r '.assets[] | select(.name | test(".*_linux_amd64.deb$")) | .browser_download_url' )

curl --show-error --silent --fail --location $download_url --output "$tmp_dir"/gh.deb

sudo dpkg --install "$tmp_dir"/gh.deb

rm "$tmp_dir"/gh.deb

gh --version
}

0 comments on commit 91e69c0

Please sign in to comment.