File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change
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
You can’t perform that action at this time.
0 commit comments