mirror of
https://github.com/kremalicious/dotfiles.git
synced 2024-11-22 01:37:14 +01:00
tweak node setup
This commit is contained in:
parent
8ab7ea182e
commit
bfe7d40090
@ -39,10 +39,12 @@ echo "------------------------------$(tput sgr0)"
|
|||||||
[ -s "$HOME/.nvm" ] && . "$HOME/.nvm/nvm.sh"
|
[ -s "$HOME/.nvm" ] && . "$HOME/.nvm/nvm.sh"
|
||||||
|
|
||||||
# Update to latest nvm Node.js
|
# Update to latest nvm Node.js
|
||||||
nvm install node
|
nvm install node --reinstall-packages-from=node
|
||||||
|
nvm alias default node
|
||||||
|
|
||||||
# update npm itself
|
# update npm itself
|
||||||
npm install npm -g
|
nvm install-latest-npm
|
||||||
|
# npm install npm -g
|
||||||
|
|
||||||
# update all global packages
|
# update all global packages
|
||||||
npm update -g
|
npm update -g
|
||||||
|
15
exports
15
exports
@ -25,19 +25,20 @@ export CDPATH=$CDPATH:~/Code
|
|||||||
|
|
||||||
# nvm
|
# nvm
|
||||||
# defer loading until needed for faster shell startup
|
# 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`)
|
# declare -a NODE_GLOBALS=(`find ~/.nvm/versions/node -maxdepth 3 -type l -wholename '*/bin/*' | xargs -n1 basename | sort | uniq`)
|
||||||
|
#
|
||||||
NODE_GLOBALS+=("node")
|
# NODE_GLOBALS+=("node")
|
||||||
NODE_GLOBALS+=("nvm")
|
# NODE_GLOBALS+=("nvm")
|
||||||
|
|
||||||
load_nvm () {
|
load_nvm () {
|
||||||
export NVM_DIR="$HOME/.nvm"
|
export NVM_DIR="$HOME/.nvm"
|
||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
}
|
}
|
||||||
|
load_nvm
|
||||||
|
|
||||||
for cmd in "${NODE_GLOBALS[@]}"; do
|
# for cmd in "${NODE_GLOBALS[@]}"; do
|
||||||
eval "${cmd}(){ unset -f ${NODE_GLOBALS}; load_nvm; ${cmd} \$@ }"
|
# eval "${cmd}(){ unset -f ${NODE_GLOBALS}; load_nvm; ${cmd} \$@ }"
|
||||||
done
|
# done
|
||||||
|
|
||||||
# pip should only run if there is a virtualenv currently activated
|
# pip should only run if there is a virtualenv currently activated
|
||||||
#export PIP_REQUIRE_VIRTUALENV=true
|
#export PIP_REQUIRE_VIRTUALENV=true
|
||||||
|
Loading…
Reference in New Issue
Block a user