2015-01-20 00:06:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-05-25 21:08:33 +00:00
|
|
|
# Installs node.js + dependencies for both Ubuntu and OS X
|
2015-01-21 06:17:31 +00:00
|
|
|
|
|
|
|
#
|
2017-04-07 02:19:16 +00:00
|
|
|
# See https://git.daplie.com/coolaj86/node-install-script
|
2015-01-21 06:17:31 +00:00
|
|
|
#
|
|
|
|
|
2017-05-25 21:08:33 +00:00
|
|
|
# curl -fsSL https://example.com/setup.bash | bash
|
|
|
|
# wget -nv https://example.com/setup.bash -O - | bash
|
2015-01-21 06:17:31 +00:00
|
|
|
|
2017-05-16 03:56:04 +00:00
|
|
|
set -e
|
|
|
|
set -u
|
|
|
|
|
2017-09-02 02:54:43 +00:00
|
|
|
BASE_URL="https://git.daplie.com/Daplie/node-install-script/raw/master"
|
2015-01-21 06:17:31 +00:00
|
|
|
|
|
|
|
#######################
|
|
|
|
# Download installers #
|
|
|
|
#######################
|
|
|
|
|
2017-05-25 21:08:33 +00:00
|
|
|
INSTALL_FILE_REMOTE="setup.bash"
|
|
|
|
INSTALL_FILE="node.setup.bash"
|
2016-03-28 19:50:12 +00:00
|
|
|
if [ ! -e "/tmp/${INSTALL_FILE}" ]
|
|
|
|
then
|
2017-05-25 21:08:33 +00:00
|
|
|
if [ -n "$(which curl)" ]; then
|
|
|
|
curl --silent "${BASE_URL}/${INSTALL_FILE_REMOTE}" \
|
|
|
|
-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 19:50:12 +00: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-21 06:17:31 +00:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-05-08 16:20:59 +00:00
|
|
|
|
2017-05-25 21:08:33 +00:00
|
|
|
bash "/tmp/${INSTALL_FILE}" --no-dev-deps
|