You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
957 B
Plaintext
27 lines
957 B
Plaintext
4 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
3 years ago
|
set -euo pipefail
|
||
4 years ago
|
|
||
|
# shellcheck disable=SC1090
|
||
4 years ago
|
source "${XDG_DATA_HOME}/buddy-up/includes/node.sh"
|
||
4 years ago
|
|
||
2 years ago
|
VERSION=${VERSION:-$(node_lts)}
|
||
3 years ago
|
DEST=${XDG_DATA_HOME}/apps/releases/node
|
||
|
CURRENT=${DEST}/current
|
||
|
|
||
|
# shellcheck disable=SC2034
|
||
|
URL=https://nodejs.org/dist/${VERSION}/node-${VERSION}-$(get_os)-$(get_arch).tar.xz
|
||
4 years ago
|
|
||
|
extract_tarball "${URL}" "${DEST}/${VERSION}" "--strip-components 1"
|
||
|
set_current_link "${DEST}" "${VERSION}"
|
||
|
|
||
2 years ago
|
APPS=$(find "${DEST}/${VERSION}/bin" -not -type d -exec basename {} ';')
|
||
4 years ago
|
for app in ${APPS}; do
|
||
4 years ago
|
set_symlink "${CURRENT}/bin/${app}" "${XDG_BIN_HOME}/${app}"
|
||
4 years ago
|
done
|
||
4 years ago
|
|
||
|
set_symlink "${CURRENT}/include/node" "${XDG_INCLUDE_HOME}/node"
|
||
|
set_symlink "${CURRENT}/share/doc/node" "${XDG_DATA_HOME}/doc/node"
|
||
|
set_symlink "${CURRENT}/share/man/man1/node.1" "${MAN_DIR}/node.1"
|
||
|
set_symlink "${CURRENT}/share/systemtap/tapset/node.stp" "${XDG_DATA_HOME}/systemtap/tapset/node.stp"
|