ga-wdi-boston / orientation

Instructions for students beginning General Assembly's WDI program in Boston
Other
11 stars 198 forks source link

nvm.sh contains both the linux and mac versions #260

Closed BenGitsCode closed 7 years ago

BenGitsCode commented 7 years ago

current nvm.sh:

if [[ $(uname -s) != 'Darwin' ]]; then
  export NVM_DIR="/home/$(whoami)/.nvm"
  [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
else
  export NVM_DIR=~/.nvm
  source $(brew --prefix nvm)/nvm.sh
fi

nvm install --lts=boron || nvm install 6.9.4
nvm alias default v6
nvm use default

This contains both the macOS AND Linux

snippet from the original install fest for reference.

**Restart your terminal (close it and reopen it; not just the window!)**

-   Open your `.bashrc` file by typing `atom ~/.bashrc` and paste in the
    following depending on your operating system:

    ```bash
    # OSX ONLY
    export NVM_DIR=~/.nvm
    source $(brew --prefix nvm)/nvm.sh
```bash
#LINUX ONLY
export NVM_DIR="/home/$(whoami)/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
```
gaand commented 7 years ago

@BenGitsCode The script is wrong, but not entirely for the reason you think. Please tell me why.

scottyscripts commented 7 years ago

no need to specify setting NVM_DIR, also lines not being added to .bashrc like they should

BenGitsCode commented 7 years ago

I opened this per @jrhorn424 ' s instruction, maybe I misunderstood?

BenGitsCode commented 7 years ago

Ah I see, is that what you meant @gaand ?

scottyscripts commented 7 years ago

this script now adds necessary lines to .bashrc. Change how the script is run to account for necessary restart. Before developers would 1) brew install nvm 2) RESTART Terminal 3) run config/nvm.sh 4) RESTART Terminal This was not adding necessary setup to .bashrc thus making nvm unavailable

NOW developers will 1) run config/nvm.sh (now includes brew install) 2) RESTART Terminal 3) run config/nvm.sh node 4) RESTART Terminal This is tested on MAC for fresh install