node-installer.sh/setup-min.sh

45 lines
1.1 KiB
Bash
Raw Permalink Normal View History

2015-01-19 17:06:29 -07:00
#!/bin/bash
2017-05-25 15:08:33 -06:00
# Installs node.js + dependencies for both Ubuntu and OS X
2015-01-20 23:17:31 -07:00
#
2017-11-03 14:31:34 -06:00
# See https://git.colaj86.com/coolaj86/node-installer.sh
2015-01-20 23:17:31 -07:00
#
2017-05-25 15:08:33 -06:00
# curl -fsSL https://example.com/setup.bash | bash
# wget -nv https://example.com/setup.bash -O - | bash
2015-01-20 23:17:31 -07:00
2017-05-15 21:56:04 -06:00
set -e
set -u
2017-11-03 14:31:34 -06:00
BASE_URL="https://git.coolaj86.com/coolaj86/node-installer.sh/raw/master"
2015-01-20 23:17:31 -07:00
#######################
# Download installers #
#######################
2017-11-03 14:51:47 -06:00
INSTALL_FILE_REMOTE="install.sh"
INSTALL_FILE="node-installer.sh"
2016-03-28 15:50:12 -04:00
if [ ! -e "/tmp/${INSTALL_FILE}" ]
then
2017-05-25 15:08:33 -06:00
if [ -n "$(which curl)" ]; then
2017-11-02 04:19:58 +00:00
curl --silent -L "${BASE_URL}/${INSTALL_FILE_REMOTE}" \
2017-05-25 15:08:33 -06:00
-o "/tmp/${INSTALL_FILE}" || echo 'error setup script: '"${BASE_URL}/${INSTALL_FILE_REMOTE}"
elif [ -n "$(which wget)" ]; then
wget --quiet "${BASE_URL}/${INSTALL_FILE_REMOTE}" \
-O "/tmp/${INSTALL_FILE}" || echo 'error setup script: '"${BASE_URL}/${INSTALL_FILE_REMOTE}"
2016-03-28 15:50:12 -04:00
else
echo "Found neither 'curl' nor 'wget'. Can't Continue."
exit 1
fi
fi
if [ ! -e "/tmp/${INSTALL_FILE}" ]
then
echo "Error Downloading Install File"
2015-01-20 23:17:31 -07:00
exit 1
fi
2017-05-08 16:20:59 +00:00
2017-05-25 15:08:33 -06:00
bash "/tmp/${INSTALL_FILE}" --no-dev-deps