#!/bin/bash
DEFAULT_EXCLUDES={README.md,bootstrap.sh,LICENSE-MIT.txt}

# if no target user has been specified, then complain
[[ ! $1 ]] && abort "No target user specified for dotfiles, you need one"

# initialise exclude list to default
EXCLUDE=${2-DEFAULT_EXCLUDES}

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

# require curl
require packages curl

# head into our local user directory
cd ~/

# bring down the dot files
curl -#L https://github.com/$1/dotfiles/tarball/master | tar -xzv --strip-components 1 --exclude=$EXCLUDE