Skip to content

Commit 9d00c83

Browse files
authored
Merge pull request #42 from Heshdude/update-readme-md-and-installers-toml-41
Update installer scripts, README.md & installers.toml for #41
2 parents b88fea8 + 6f6474c commit 9d00c83

File tree

3 files changed

+12
-14
lines changed

3 files changed

+12
-14
lines changed

installers.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[node]
2-
installers = "apt,yum,dnf,apk"
2+
installers = "dnf,apt,apk,yum"
33
name = "NodeJS"
4+
description = "NodeJs v12"
45

56
[kubectl]
67
installers = "apt,yum,curl"

installers/node/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 -y gcc-c++ make;curl -sL https://rpm.nodesource.com/setup_12.x | $SUDO -E bash -;$SUDO dnf install nodejs;;elif [ ! -z $APT_GET_CMD ]; then;curl -sL https://deb.nodesource.com/setup_12.x | $SUDO -E bash -;$SUDO apt-get install -y nodejs;;elif [ ! -z $APK_CMD ]; then;$SUDO apk update;$SUDO apk add nodejs;;elif [ ! -z $YUM_CMD ]; then;$SUDO yum install nodejs12;;else echo "Couldn't install package";exit 1;;fi;

installers/node/installer.sh

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,27 +40,22 @@ error () {
4040
log "$RED ERROR$RESET $1"
4141
}
4242

43-
if [ ! -z $APT_GET_CMD ]; then
44-
if [ -n "$(uname -a | grep Ubuntu)" ]; then
45-
curl -sL https://deb.nodesource.com/setup_12.x | $SUDO -E bash -
46-
$SUDO apt-get install -y nodejs
47-
else
48-
curl -sL https://deb.nodesource.com/setup_12.x | bash -
49-
$SUDO apt-get install -y nodejs
50-
fi
51-
52-
elif [ ! -z $YUM_CMD ]; then
53-
$SUDO yum install nodejs12
54-
55-
elif [ ! -z $DNF_CMD ]; then
43+
if [ ! -z $DNF_CMD ]; then
5644
$SUDO dnf install -y gcc-c++ make
5745
curl -sL https://rpm.nodesource.com/setup_12.x | $SUDO -E bash -
5846
$SUDO dnf install nodejs
5947

48+
elif [ ! -z $APT_GET_CMD ]; then
49+
curl -sL https://deb.nodesource.com/setup_12.x | $SUDO -E bash -
50+
$SUDO apt-get install -y nodejs
51+
6052
elif [ ! -z $APK_CMD ]; then
6153
$SUDO apk update
6254
$SUDO apk add nodejs
6355

56+
elif [ ! -z $YUM_CMD ]; then
57+
$SUDO yum install nodejs12
58+
6459
else
6560
echo "Couldn't install package"
6661
exit 1;

0 commit comments

Comments
 (0)