diff options
Diffstat (limited to 'src/github-cli/install.sh')
-rwxr-xr-x | src/github-cli/install.sh | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/github-cli/install.sh b/src/github-cli/install.sh index 4fea41b..689a816 100755 --- a/src/github-cli/install.sh +++ b/src/github-cli/install.sh @@ -138,21 +138,16 @@ receive_gpg_keys() { fi } -# Function to run apt-get if needed -apt_get_update_if_needed() +apt_get_update() { - if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then - echo "Running apt-get update..." - apt-get update - else - echo "Skipping apt-get update." - fi + echo "Running apt-get update..." + apt-get update -y } # Checks if packages are installed and installs them if not check_packages() { if ! dpkg -s "$@" > /dev/null 2>&1; then - apt_get_update_if_needed + apt_get_update apt-get -y install --no-install-recommends "$@" fi } @@ -162,7 +157,7 @@ export DEBIAN_FRONTEND=noninteractive # Install curl, apt-transport-https, curl, gpg, or dirmngr, git if missing check_packages curl ca-certificates apt-transport-https dirmngr gnupg2 if ! type git > /dev/null 2>&1; then - apt_get_update_if_needed + apt_get_update apt-get -y install --no-install-recommends git fi |