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.
28 lines
981 B
Plaintext
28 lines
981 B
Plaintext
5 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
4 years ago
|
set -e
|
||
|
|
||
4 years ago
|
# shellcheck disable=SC1090
|
||
|
source "${XDG_DATA_HOME}/buddy-up/includes/node.sh"
|
||
5 years ago
|
|
||
2 years ago
|
VERSION=${VERSION:-$(node_lts)}
|
||
4 years ago
|
PREFIX=${PREFIX:-/usr/local}
|
||
2 years ago
|
DEST=${PREFIX}/apps/releases/node
|
||
|
CURRENT=${DEST}/current
|
||
5 years ago
|
|
||
3 years ago
|
# 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" sudo
|
||
|
set_current_link "${DEST}" "${VERSION}" sudo
|
||
4 years ago
|
|
||
2 years ago
|
APPS=$(find "${DEST}/${VERSION}/bin" -not -type d -exec basename {} ';')
|
||
4 years ago
|
for app in ${APPS}; do
|
||
|
set_symlink "${CURRENT}/bin/${app}" "${PREFIX}/bin/${app}" sudo
|
||
5 years ago
|
done
|
||
|
|
||
4 years ago
|
set_symlink "${CURRENT}/include/node" "${PREFIX}/include/node" sudo
|
||
4 years ago
|
set_symlink "${CURRENT}/share/doc/node" "${PREFIX}/share/doc/node" sudo
|
||
|
set_symlink "${CURRENT}/share/man/man1/node.1" "${PREFIX}/share/man/man1/node.1" sudo
|
||
|
set_symlink "${CURRENT}/share/systemtap/tapset/node.stp" "${PREFIX}/share/systemtap/tapset/node.stp" sudo
|