Skip to content

Commit e87e1b9

Browse files
committed
[#1] Add support for more package managers
1 parent aeb952d commit e87e1b9

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

installers/git/installer.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/bin/sh
22

3-
YUM_CMD=$(which yum)
4-
APT_GET_CMD=$(which apt-get)
5-
DNF_CMD=$(which dnf)
3+
YUM_CMD=$(which yum) # yum package manager for RHEL & CentOS
4+
DNF_CMD=$(which dnf) # dnf package manager for new RHEL & CentOS
5+
APT_GET_CMD=$(which apt-get) # apt package manager for Ubuntu & other Debian based distributions
6+
PACMAN_CMD=$(which pacman) # pacman package manager for ArchLinux
7+
APK_CMD=$(which apk) # apk package manager for Alpine
68

79
if [ ! -z $APT_GET_CMD ]; then
810
sudo apt-get update
@@ -11,8 +13,12 @@ DNF_CMD=$(which dnf)
1113
sudo dnf install git
1214
elif [ ! -z $YUM_CMD ]; then
1315
sudo yum install git
16+
elif [ ! -z $PACMAN_CMD ]; then
17+
pacman -Sy git
18+
elif [ ! -z $APK_CMD ]; then
19+
sudo apk add git
1420
else
15-
echo "error can't install package"
21+
echo "Couldn't install package"
1622
exit 1;
1723
fi
1824

0 commit comments

Comments
 (0)