move paths to bash vars

This commit is contained in:
AJ ONeal 2015-01-20 23:16:58 -07:00
parent c4c74e3f46
commit 835ebe737f
1 changed files with 4 additions and 3 deletions

View File

@ -1,10 +1,11 @@
IOJS_VER=${1} IOJS_VER=${1}
IOJS_REMOTE="http://iojs.org/dist/${IOJS_VER}/iojs-${IOJS_VER}.pkg"
IOJS_PKG="/tmp/iojs-${IOJS_VER}.pkg"
if [ -n "${IOJS_VER}" ]; then if [ -n "${IOJS_VER}" ]; then
echo "installing io.js as iojs ${IOJS_VER}..." echo "installing io.js as iojs ${IOJS_VER}..."
curl -fsSL "http://iojs.org/dist/${IOJS_VER}/iojs-${IOJS_VER}.pkg" -o "/tmp/iojs-${IOJS_VER}.pkg" curl -fsSL "${IOJS_REMOTE}" -o "${IOJS_PKG}"
sudo /usr/sbin/installer -pkg "/tmp/iojs-${IOJS_VER}.pkg" -target / sudo /usr/sbin/installer -pkg "${IOJS_PKG}" -target /
sudo chown -R $(whoami) /usr/local 2>/dev/null sudo chown -R $(whoami) /usr/local 2>/dev/null
fi fi