Skip to content

Commit d7f0c4f

Browse files
authored
Merge pull request #2 from leopardslab/installer/git
[#1] Add Git installer script
2 parents dbf0785 + e87e1b9 commit d7f0c4f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

installers/git/installer.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
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
8+
9+
if [ ! -z $APT_GET_CMD ]; then
10+
sudo apt-get update
11+
sudo apt-get install git
12+
elif [ ! -z $DNF_CMD ]; then
13+
sudo dnf install git
14+
elif [ ! -z $YUM_CMD ]; then
15+
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
20+
else
21+
echo "Couldn't install package"
22+
exit 1;
23+
fi
24+
25+
git --version

0 commit comments

Comments
 (0)