From bfe7d40090780a7f30ba8e293ea10a663ed4e354 Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sat, 30 Jan 2021 22:15:43 +0100 Subject: [PATCH] tweak node setup --- bin/update-everything.sh | 6 ++++-- exports | 15 ++++++++------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/bin/update-everything.sh b/bin/update-everything.sh index eac04bc..da46b90 100755 --- a/bin/update-everything.sh +++ b/bin/update-everything.sh @@ -39,10 +39,12 @@ echo "------------------------------$(tput sgr0)" [ -s "$HOME/.nvm" ] && . "$HOME/.nvm/nvm.sh" # Update to latest nvm Node.js -nvm install node +nvm install node --reinstall-packages-from=node +nvm alias default node # update npm itself -npm install npm -g +nvm install-latest-npm +# npm install npm -g # update all global packages npm update -g diff --git a/exports b/exports index d562dfb..a96afe0 100644 --- a/exports +++ b/exports @@ -25,19 +25,20 @@ export CDPATH=$CDPATH:~/Code # nvm # defer loading until needed for faster shell startup -declare -a NODE_GLOBALS=(`find ~/.nvm/versions/node -maxdepth 3 -type l -wholename '*/bin/*' | xargs -n1 basename | sort | uniq`) - -NODE_GLOBALS+=("node") -NODE_GLOBALS+=("nvm") +# declare -a NODE_GLOBALS=(`find ~/.nvm/versions/node -maxdepth 3 -type l -wholename '*/bin/*' | xargs -n1 basename | sort | uniq`) +# +# NODE_GLOBALS+=("node") +# NODE_GLOBALS+=("nvm") load_nvm () { export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" } +load_nvm -for cmd in "${NODE_GLOBALS[@]}"; do - eval "${cmd}(){ unset -f ${NODE_GLOBALS}; load_nvm; ${cmd} \$@ }" -done +# for cmd in "${NODE_GLOBALS[@]}"; do +# eval "${cmd}(){ unset -f ${NODE_GLOBALS}; load_nvm; ${cmd} \$@ }" +# done # pip should only run if there is a virtualenv currently activated #export PIP_REQUIRE_VIRTUALENV=true