chore: organisation
This commit is contained in:
33
script/install.d/40-gh.sh
Normal file
33
script/install.d/40-gh.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Description:
|
||||
# Install GitHub CLI.
|
||||
#
|
||||
|
||||
# Skip in Codespaces (pre-installed in universal image)
|
||||
[[ "$DOTS_ENV" == "codespaces" ]] && { log_pass "Skipping in Codespaces"; return 0; }
|
||||
|
||||
if ! command -v gh &>/dev/null; then
|
||||
case "$DOTS_PKG" in
|
||||
apt)
|
||||
# https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt
|
||||
sudo mkdir -p -m 755 /etc/apt/keyrings && wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg >/dev/null &&
|
||||
sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg &&
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list >/dev/null &&
|
||||
sudo apt-get update -qq &&
|
||||
sudo apt-get install -qq gh
|
||||
;;
|
||||
pacman)
|
||||
sudo pacman -S --noconfirm github-cli
|
||||
;;
|
||||
brew)
|
||||
brew install gh
|
||||
;;
|
||||
*)
|
||||
log_warn "Skipping GitHub CLI install: no supported package manager found"
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
gh --version
|
||||
Reference in New Issue
Block a user