-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathgh.sh
More file actions
executable file
·17 lines (15 loc) · 854 Bytes
/
gh.sh
File metadata and controls
executable file
·17 lines (15 loc) · 854 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash -e
################################################################################
## File: github-cli.sh
## Desc: Installs GitHub CLI
## Must be run as non-root user after homebrew
################################################################################
# source: https://github.com/actions/virtual-environments/blob/be27ebfdb31aece2c90fbe1984c1749cbd1b464c/images/linux/scripts/installers/github-cli.sh
# Install GitHub CLI
ARCH=$(uname -m)
if [ "$ARCH" = x86_64 ]; then ARCH=amd64; fi
if [ "$ARCH" = aarch64 ]; then ARCH=arm64; fi
if [ "$ARCH" = armv7l ]; then ARCH=armv6; fi
url=$(curl -s https://api.github.com/repos/cli/cli/releases/latest | jq -r ".assets[].browser_download_url|select(contains(\"linux\") and contains(\"$ARCH\") and contains(\".deb\"))")
wget -q "$url" -O "/tmp/gh.deb"
apt install /tmp/gh.deb