#!/bin/bash
# if running as root, abort this is a userland provisioning script
[[ $IS_ROOT ]] && abort "Cannot install nvm for root user"

# ensure we have git
require packages git

# if no ~/.oh-my-zsh dir, then clone it
if [ ! -d ~/.nvm ]; then
  # clone nvm
  git clone git://github.com/creationix/nvm.git ~/.nvm
else
  cd ~/.nvm
  git pull
fi

# TODO: check the current shell and load nvm on startup