forked from coolaj86/node-installer.sh
move paths to bash vars
This commit is contained in:
parent
05dd997bf6
commit
6d2d7e7c20
|
@ -6,15 +6,26 @@ else
|
|||
ARCH="x86"
|
||||
fi
|
||||
|
||||
IOJS_REMOTE="http://iojs.org/dist/${IOJS_VER}/iojs-${IOJS_VER}-linux-${ARCH}.tar.gz"
|
||||
IOJS_LOCAL="/tmp/iojs-${IOJS_VER}-linux-${ARCH}.tar.gz"
|
||||
IOJS_UNTAR="/tmp/iojs-${IOJS_VER}-linux-${ARCH}"
|
||||
|
||||
if [ -n "${IOJS_VER}" ]; then
|
||||
echo "installing io.js as iojs ${IOJS_VER}..."
|
||||
|
||||
curl -fsSL "http://iojs.org/dist/${IOJS_VER}/iojs-${IOJS_VER}-linux-${ARCH}.tar.gz" \
|
||||
-o "/tmp/iojs-${IOJS_VER}-linux-${ARCH}.tar.gz"
|
||||
pushd /tmp >/dev/null
|
||||
tar xf /tmp/iojs-${IOJS_VER}-linux-${ARCH}.tar.gz
|
||||
rm iojs-${IOJS_VER}-linux-x64/{LICENSE,CHANGELOG.md,README.md}
|
||||
sudo rsync -a "/tmp/iojs-${IOJS_VER}-linux-${ARCH}/" /usr/local/
|
||||
if [ -n "$(which curl 2>/dev/null)" ]; then
|
||||
curl -fsSL ${IOJS_REMOTE} -o ${IOJS_LOCAL} || echo 'error downloading io.js'
|
||||
elif [ -n "$(which wget 2>/dev/null)" ]; then
|
||||
wget --quiet ${IOJS_REMOTE} -O ${IOJS_LOCAL} || echo 'error downloading io.js'
|
||||
else
|
||||
echo "'wget' and 'curl' are missing. Please run the following command and try again"
|
||||
echo "\tsudo apt-get install --yes curl wget"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tar xf ${IOJS_LOCAL}
|
||||
rm ${IOJS_UNTAR}/{LICENSE,CHANGELOG.md,README.md}
|
||||
sudo rsync -a "${IOJS_UNTAR}/" /usr/local/
|
||||
|
||||
|
||||
sudo chown -R $(whoami) /usr/local
|
||||
|
|
Loading…
Reference in New Issue