Skip to content

Commit

Permalink
Add pacman to the install script
Browse files Browse the repository at this point in the history
The install.sh script was modified to include a test for the pacman package manager, and to use it should it be present.
This is necessary for the script to work on Arch based Linux distributions, or more generally ones that use pacman as their main package manager.
It was tested by simply trying it out on two local machines, one running Manjaro, one running Arch. In both cases it worked as expected, and without error.

Signed-off-by: Jacob Palecek <[email protected]>
  • Loading branch information
jjnp authored and alexellis committed Sep 15, 2021
1 parent dec02f3 commit e76d0d3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion hack/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,22 @@ has_apt_get() {
[ -n "$(command -v apt-get)" ]
}

has_pacman() {
[ -n "$(command -v pacman)" ]
}

install_required_packages() {
if $(has_apt_get); then
$SUDO apt-get update -y
$SUDO apt-get install -y curl runc bridge-utils
elif $(has_yum); then
$SUDO yum check-update -y
$SUDO yum install -y curl runc
elif $(has_pacman); then
$SUDO pacman -Syy
$SUDO pacman -Sy curl runc bridge-utils
else
fatal "Could not find apt-get or yum. Cannot install dependencies on this OS."
fatal "Could not find apt-get, yum, or pacman. Cannot install dependencies on this OS."
exit 1
fi
}
Expand Down

0 comments on commit e76d0d3

Please sign in to comment.