2010-11-25 17:42:24 +08:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
dir=$npm_config_root/.npm/$npm_package_name/$npm_package_version/package
|
|
|
|
|
|
|
|
# add lines to the bashrc.
|
|
|
|
has=$(cat ~/.bashrc | egrep "^# ADDED BY npm FOR NVM$" || true)
|
|
|
|
if [ "x$has" != "x" ]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
cat <<NVM_CODE >>~/.bashrc
|
|
|
|
# ADDED BY npm FOR NVM
|
2010-12-11 04:43:27 +08:00
|
|
|
. $dir/nvm.sh
|
2010-11-25 17:42:24 +08:00
|
|
|
# END ADDED BY npm FOR NVM
|
|
|
|
NVM_CODE
|
|
|
|
|
|
|
|
cat <<NVM_HOWTO
|
|
|
|
|
|
|
|
To use nvm, source your .bashrc file like this:
|
|
|
|
. ~/.bashrc
|
|
|
|
or log out and back into your terminal.
|
|
|
|
|
|
|
|
NVM_HOWTO
|