dnote/scripts/vagrant/install_node.sh
Sung Won Cho 4a3fd2d1a7
Use Vagrant for easy development setup (#297)
* Use vagrant

* Stop using polling

* Fix test

* Document

* Fix
2019-11-03 20:04:17 -08:00

19 lines
593 B
Bash
Executable file

#!/usr/bin/env bash
# shellcheck disable=SC1090,SC1091
set -eux
VERSION=10.15.0
NVM_VERSION=v0.35.0
# Install nvm
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/"$NVM_VERSION"/install.sh | bash
cat >> /home/vagrant/.bash_profile<< EOF
export NVM_DIR="\$([ -z "\${XDG_CONFIG_HOME-}" ] && printf %s "\${HOME}/.nvm" || printf %s "\${XDG_CONFIG_HOME}/nvm")"
[ -s "\$NVM_DIR/nvm.sh" ] && \. "\$NVM_DIR/nvm.sh" # This loads nvm
EOF
source /home/vagrant/.bash_profile
# Install a node and alias
nvm install --no-progress "$VERSION" 1>/dev/null
nvm alias default "$VERSION"
nvm use default