#!/usr/bin/env bash
# Install dotfiles
# Redirect stdout to /dev/null because vim vundler runs some semi-interactive
# installer, which screws with terminal buffer.
# There are bizarre /dev/null permission errors when redirecting to it with su -c
echo -e "\nInstalling dotfiles from https://github.com/danemacmillan/dotfiles. This will take a minute."
echo -e "--------------------------------------------------------------------------------"
echo -e "Installing for '$USER_USER' user..."
#sudo -u $USER_USER -H -s bash -c "cd /home/$USER_USER && git clone git@github.com:danemacmillan/dotfiles.git .dotfiles && cd .dotfiles && source bootstrap.sh"
sudo -u $USER_USER -H -i bash -c "cd /home/$USER_USER && git clone git@github.com:danemacmillan/dotfiles.git .dotfiles && cd .dotfiles && source bootstrap.sh"
# Set permissions on regular user.
#echo -e "Setting permissions for $USER_USER:$USER_GROUP on /home/$USER_USER"
#chown -R $USER_USER:$USER_GROUP /home/$USER_USER
echo -e "Installing for 'root' user..."
#cd /root && git clone git@github.com:danemacmillan/dotfiles.git .dotfiles && cd .dotfiles && source bootstrap.sh &> /dev/null
cd /root && git clone git@github.com:danemacmillan/dotfiles.git .dotfiles && cd .dotfiles && source bootstrap.sh
echo -e "\ndotfiles installed successfully!"

#!/usr/bin/env bash
# Install dotfiles
echo -e "\nInstalling dotfiles from https://github.com/danemacmillan/dotfiles. This will take a minute."
echo -e "--------------------------------------------------------------------------------"
echo -e "Installing for '$USER_USER' user..."
sudo -u $USER_USER -H -i bash -c "cd /home/$USER_USER && git clone git@github.com:danemacmillan/dotfiles.git .dotfiles && source /home/$USER_USER/.dotfiles/bootstrap.sh"
echo -e "Installing for 'root' user..."
cd /root && git clone git@github.com:danemacmillan/dotfiles.git .dotfiles && source /root/.dotfiles/bootstrap.sh
echo -e "\ndotfiles installed successfully (unless you are on Windows)!"
echo -e "Windows users must 'vagrant ssh' in and run 'source ~/.dotfiles/bootstrap.sh' the first time."

Add message for Windows users.
Add message for Windows users.
