Skip to content

Commit

Permalink
Link apt-fast to apt-get if missing
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Jun 16, 2024
1 parent 4df90f7 commit 1cdd1d9
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/scripts/linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ add_sudo() {
fi
}

# Function to setup environment for self-hosted runners.
self_hosted_helper() {
# Function to link apt-fast to apt-get
link_apt_fast() {
if ! command -v apt-fast >/dev/null; then
sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast
trap "sudo rm -f /usr/bin/apt-fast 2>/dev/null" exit
fi
}

# Function to setup environment for self-hosted runners.
self_hosted_helper() {
install_packages apt-transport-https ca-certificates curl file make jq unzip autoconf automake gcc g++ gnupg
}

Expand Down Expand Up @@ -288,7 +292,8 @@ debconf_fix="DEBIAN_FRONTEND=noninteractive"
apt_install="sudo $debconf_fix apt-fast install -y --no-install-recommends"
scripts="$src"/scripts

add_sudo
add_sudo
link_apt_fast

. /etc/os-release
# shellcheck source=.
Expand Down

0 comments on commit 1cdd1d9

Please sign in to comment.