File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 22set -e
33
44export NVM_REPO=" https://github.com/creationix/nvm.git"
5- export NVM_DIR=" $( pwd) /.nvm"
5+ export NVM_DIR=" ${PROJECT_DIR :- $ (pwd)} /.nvm"
66export NODE_VER=" v5.5.0"
77
8- install_nvm () {
8+ activate_nvm () {
99 if [ ! -d " $NVM_DIR " ] ; then
1010 git clone --depth=1 $NVM_REPO " $NVM_DIR "
1111 else
1212 echo " NVM detected at $NVM_DIR "
1313 fi
14- }
1514
16- activate_nvm () {
1715 . " $NVM_DIR /nvm.sh"
1816}
1917
@@ -22,11 +20,14 @@ installed_under_nvm() {
2220}
2321
2422install_node () {
25- nvm install $NODE_VER
26- nvm use $NODE_VER
23+ if ! nvm use $NODE_VER ; then
24+ nvm install $NODE_VER
25+ nvm use $NODE_VER
26+ # upgrade npm to latest version
27+ npm install -g npm
28+ fi
2729}
2830
29-
3031install_latest_tns () {
3132 if installed_under_nvm tns ; then
3233 echo " tns already installed."
@@ -36,7 +37,6 @@ install_latest_tns() {
3637}
3738
3839activate_node_env () {
39- install_nvm
4040 activate_nvm
4141 install_node
4242 install_latest_tns
You can’t perform that action at this time.
0 commit comments