|
|
|
@ -5,9 +5,10 @@ set -e
|
|
|
|
|
# shellcheck disable=SC1090
|
|
|
|
|
source "${XDG_DATA_HOME}/buddy-up/includes/node.sh"
|
|
|
|
|
|
|
|
|
|
VERSION=${VERSION:-$(node_lts)}
|
|
|
|
|
PREFIX=${PREFIX:-/usr/local}
|
|
|
|
|
DEST="${PREFIX}/apps/releases/node"
|
|
|
|
|
CURRENT="${DEST}/current"
|
|
|
|
|
DEST=${PREFIX}/apps/releases/node
|
|
|
|
|
CURRENT=${DEST}/current
|
|
|
|
|
|
|
|
|
|
# shellcheck disable=SC2034
|
|
|
|
|
URL=https://nodejs.org/dist/${VERSION}/node-${VERSION}-$(get_os)-$(get_arch).tar.xz
|
|
|
|
@ -15,7 +16,7 @@ URL=https://nodejs.org/dist/${VERSION}/node-${VERSION}-$(get_os)-$(get_arch).tar
|
|
|
|
|
extract_tarball "${URL}" "${DEST}/${VERSION}" "--strip-components 1" sudo
|
|
|
|
|
set_current_link "${DEST}" "${VERSION}" sudo
|
|
|
|
|
|
|
|
|
|
APPS=$(find "${CURRENT}"/bin -not -type d -exec basename {} ';')
|
|
|
|
|
APPS=$(find "${DEST}/${VERSION}/bin" -not -type d -exec basename {} ';')
|
|
|
|
|
for app in ${APPS}; do
|
|
|
|
|
set_symlink "${CURRENT}/bin/${app}" "${PREFIX}/bin/${app}" sudo
|
|
|
|
|
done
|
|
|
|
|