-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathnvm.sh
More file actions
18 lines (15 loc) · 741 Bytes
/
nvm.sh
File metadata and controls
18 lines (15 loc) · 741 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/bash -e
################################################################################
## File: nvm.sh
## Desc: Installs Nvm
################################################################################
export NVM_DIR="/etc/skel/.nvm"
mkdir $NVM_DIR
VERSION=$(curl -s https://api.github.com/repos/nvm-sh/nvm/releases/latest | jq -r '.tag_name')
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$VERSION/install.sh | bash
echo 'NVM_DIR=$HOME/.nvm' | tee -a /etc/environment
echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm' | tee -a /etc/skel/.bash_profile
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
invoke_tests "Tools" "nvm"
# set system node.js as default one
nvm alias default system