generated from anishathalye/dotfiles_template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-github.sh
executable file
·25 lines (22 loc) · 946 Bytes
/
setup-github.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env bash
if [ -n "${SKIP_SETUP_SCRIPTS}" ]; then
exit 0
fi
function setup_github() {
if which pacman > /dev/null 2>&1; then
./aptbrew.sh github-cli
elif which dnf > /dev/null 2>&1; then
sudo dnf install -y gh
elif which apt > /dev/null 2>&1; then
# TODO this is untested on linux
type -p curl >/dev/null || sudo apt install curl -y
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/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 update \
&& sudo apt install gh -y
elif which brew > /dev/null 2>&1; then
brew install gh
fi
}
setup_github