Skip to content

Commit ecbc05c

Browse files
authored
Merge pull request #44 from Heshdude/update-readme-md-and-installers-toml-43
Update installer scripts, README.md & installers.toml for #43
2 parents ed79ac4 + c9ad8bb commit ecbc05c

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ This will install Git on your machine!
2525
|NodeJS |Yes|Yes|No |Yes|Yes|No |https://installer.to/node |
2626
|Kubectl |Yes|Yes|No |No |No |Yes |https://installer.to/kubectl|
2727
|Git |Yes|Yes|Yes |Yes|Yes|No |https://installer.to/git |
28+
|Pip3 |Yes|Yes|Yes |Yes|Yes|No |https://installer.to/pip3 |
2829
|gCloud |No |No |No |No |No |Yes |https://installer.to/gcloud |
2930
|Nginx |Yes|Yes|Yes |Yes|Yes|No |https://installer.to/nginx |
3031
|Fabric |No |No |No |No |No |Yes |https://installer.to/hlf |

installers.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ installers = "apt,yum,pacman,dnf,apk"
1313
name = "Git"
1414
description = "Git SVM"
1515

16+
[pip3]
17+
installers = "dnf,pacman,apt,apk,yum"
18+
name = "Pip3"
19+
description = "Pip is the package installer for Python"
20+
1621
[gcloud]
1722
installers = "curl"
1823
name = "gCloud"

installers/pip3/installer.min.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
;CURL_CMD=$(which curl);YUM_CMD=$(which yum);DNF_CMD=$(which dnf);APT_GET_CMD=$(which apt-get);PACMAN_CMD=$(which pacman);APK_CMD=$(which apk);GIT_CMD=$(which git);SUDO_CMD=$(which sudo);;USER="$(id -un 2>/dev/null || true)";SUDO='';if [ "$USER" != 'root' ]; then;if [ ! -z $SUDO_CMD ]; then;SUDO='sudo';else cat >&2 <<-'EOF';Error: this installer needs the ability to run commands as root.;We are unable to find "sudo". Make sure its available to make this happen;EOF;exit 1;fi;fi;;RESET='';RED='';GREEN='';YELLOW='';log () { echo "[`date "+%Y.%m.%d-%H:%M:%S%Z"`]$1 $2"; };info () { log "$GREEN INFO$RESET $1"; };warn () { log "$YELLOW WARN$RESET $1"; };error () { log "$RED ERROR$RESET $1"; };;if [ ! -z $DNF_CMD ]; then;$SUDO dnf install python3-pip;;elif [ ! -z $PACMAN_CMD ]; then;pacman -S python-pip;;elif [ ! -z $APT_GET_CMD ]; then;$SUDO apt-get update;$SUDO apt install python3-pip;;elif [ ! -z $APK_CMD ]; then;$SUDO apk add py3-pip;;elif [ ! -z $YUM_CMD ]; then;$SUDO yum install python3-pip;;else echo "Couldn't install package";exit 1;;fi;

installers/pip3/installer.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/sh
2+
3+
CURL_CMD=$(which curl)
4+
YUM_CMD=$(which yum)
5+
DNF_CMD=$(which dnf)
6+
APT_GET_CMD=$(which apt-get)
7+
PACMAN_CMD=$(which pacman)
8+
APK_CMD=$(which apk)
9+
GIT_CMD=$(which git)
10+
SUDO_CMD=$(which sudo)
11+
12+
USER="$(id -un 2>/dev/null || true)"
13+
SUDO=''
14+
if [ "$USER" != 'root' ]; then
15+
if [ ! -z $SUDO_CMD ]; then
16+
SUDO='sudo'
17+
else
18+
cat >&2 <<-'EOF'
19+
Error: this installer needs the ability to run commands as root.
20+
We are unable to find "sudo". Make sure its available to make this happen
21+
EOF
22+
exit 1
23+
fi
24+
fi
25+
26+
RESET=''
27+
RED=''
28+
GREEN=''
29+
YELLOW=''
30+
log () {
31+
echo "[`date "+%Y.%m.%d-%H:%M:%S%Z"`]$1 $2"
32+
}
33+
info () {
34+
log "$GREEN INFO$RESET $1"
35+
}
36+
warn () {
37+
log "$YELLOW WARN$RESET $1"
38+
}
39+
error () {
40+
log "$RED ERROR$RESET $1"
41+
}
42+
43+
if [ ! -z $DNF_CMD ]; then
44+
$SUDO dnf install python3-pip
45+
46+
elif [ ! -z $PACMAN_CMD ]; then
47+
pacman -S python-pip
48+
49+
elif [ ! -z $APT_GET_CMD ]; then
50+
$SUDO apt-get update
51+
$SUDO apt install python3-pip
52+
53+
elif [ ! -z $APK_CMD ]; then
54+
$SUDO apk add py3-pip
55+
56+
elif [ ! -z $YUM_CMD ]; then
57+
$SUDO yum install python3-pip
58+
59+
else
60+
echo "Couldn't install package"
61+
exit 1;
62+
fi

0 commit comments

Comments
 (0)