Merge pull request #1709 from gokaygurcan/improve-nvm-installer

[Linux, macOS] Improve nvm installer
This commit is contained in:
Maxim Lobanov
2020-10-06 14:17:13 +03:00
committed by GitHub
2 changed files with 6 additions and 4 deletions

View File

@@ -7,7 +7,8 @@
export NVM_DIR="/etc/skel/.nvm"
mkdir $NVM_DIR
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
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 'export NVM_DIR=$HOME/.nvm' | tee -a /etc/skel/.bash_profile
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"