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,7 +59,10 @@ if [ -n "${NODEJS_VER}" ]; then
fi fi
mkdir -p ${NODEJS_UNTAR}/ mkdir -p ${NODEJS_UNTAR}/
tar xf ${NODEJS_LOCAL} -C ${NODEJS_UNTAR}/ --strip-components=1 # --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} rm ${NODEJS_UNTAR}/{LICENSE,CHANGELOG.md,README.md}
sudo rsync -a "${NODEJS_UNTAR}/" "$node_install_path/" sudo rsync -a "${NODEJS_UNTAR}/" "$node_install_path/"