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

# if no ~/.oh-my-zsh dir, then clone it
if [ ! -d ~/.oh-my-zsh ]; then
	require packages zsh curl git

	# run the oh-my-zsh installation instructions as per
	# https://github.com/robbyrussell/oh-my-zsh
	git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh

	# change shell to zsh
	chsh -s /bin/zsh	
fi

if [ ! -e ~/.zshrc ]; then
	cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
fi

# TODO: check the current shell, and if not zsh then change it