File tree Expand file tree Collapse file tree 2 files changed +19
-12
lines changed
Expand file tree Collapse file tree 2 files changed +19
-12
lines changed Original file line number Diff line number Diff line change 22
33set -euo pipefail
44
5+ SCRIPT_DIR=$( dirname " $( realpath " $0 " ) " )
6+
57GH_REPO=$1
68INSTALL_DIR=$( realpath $2 )
79
810cd /tmp
911
10- if ! command -v gh & > /dev/null; then
11- # https://github.com/cli/cli/blob/trunk/docs/install_linux.md
12- (type -p wget > /dev/null || (sudo apt update && sudo apt install wget -y)) \
13- && sudo mkdir -p -m 755 /etc/apt/keyrings \
14- && out=$( mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
15- && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
16- && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
17- && sudo mkdir -p -m 755 /etc/apt/sources.list.d \
18- && 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 \
19- && sudo apt update \
20- && sudo apt install gh -y
21- fi
12+ bash " $SCRIPT_DIR /install-github-cli.sh"
2213
2314tag=$( gh release list -L 1 -R ${GH_REPO} --json tagName -q .[].tagName)
2415if [[ -z " $tag " ]]; then
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ set -euo pipefail
4+
5+ if ! command -v gh & > /dev/null; then
6+ # https://github.com/cli/cli/blob/trunk/docs/install_linux.md
7+ (type -p wget > /dev/null || (sudo apt update && sudo apt install wget -y)) \
8+ && sudo mkdir -p -m 755 /etc/apt/keyrings \
9+ && out=$( mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \
10+ && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
11+ && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
12+ && sudo mkdir -p -m 755 /etc/apt/sources.list.d \
13+ && 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 \
14+ && sudo apt update \
15+ && sudo apt install gh -y
16+ fi
You can’t perform that action at this time.
0 commit comments