forked from coolaj86/node-installer.sh
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:
parent
31b92cdadb
commit
6c0afe6488
|
@ -59,11 +59,14 @@ 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
|
||||||
rm ${NODEJS_UNTAR}/{LICENSE,CHANGELOG.md,README.md}
|
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 rsync -a "${NODEJS_UNTAR}/" "$node_install_path/"
|
||||||
|
|
||||||
|
|
||||||
sudo chown -R $(whoami) "$node_install_path/lib/node_modules/"
|
sudo chown -R $(whoami) "$node_install_path/lib/node_modules/"
|
||||||
sudo chown $(whoami) ""$node_install_path"/bin/"
|
sudo chown $(whoami) ""$node_install_path"/bin/"
|
||||||
fi
|
fi
|
Loading…
Reference in New Issue