Update setup-node-ubuntu.bash to use portable copy method as opposed to non-portable `tar --strip-components` in unpacking step.

This commit is contained in:
richdex14 2017-09-03 21:13:47 -06:00
parent 31b92cdadb
commit 6c0afe6488
1 changed files with 6 additions and 3 deletions

View File

@ -59,11 +59,14 @@ if [ -n "${NODEJS_VER}" ]; then
fi
mkdir -p ${NODEJS_UNTAR}/
tar xf ${NODEJS_LOCAL} -C ${NODEJS_UNTAR}/ --strip-components=1
rm ${NODEJS_UNTAR}/{LICENSE,CHANGELOG.md,README.md}
# --strip-components isn't portable, switch to portable version by performing move step after untar
tar xf ${NODEJS_LOCAL} -C ${NODEJS_UNTAR}/ #--strip-components=1
mv ${NODEJS_UNTAR}/${NODEJS_NAME}-${NODEJS_VER}-linux-${ARCH}/* ${NODEJS_UNTAR}/
rm -rf ${NODEJS_UNTAR}/${NODEJS_NAME}-${NODEJS_VER}-linux-${ARCH} # clean up the temporary unzip folder
rm ${NODEJS_UNTAR}/{LICENSE,CHANGELOG.md,README.md}
sudo rsync -a "${NODEJS_UNTAR}/" "$node_install_path/"
sudo chown -R $(whoami) "$node_install_path/lib/node_modules/"
sudo chown $(whoami) ""$node_install_path"/bin/"
fi
fi