Skip to content

Instantly share code, notes, and snippets.

@runk
Created April 8, 2017 22:55
Show Gist options
  • Save runk/484147001583b35a19c432c855974351 to your computer and use it in GitHub Desktop.
Save runk/484147001583b35a19c432c855974351 to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ "$SHELL" != "/bin/zsh" ]; then
echo "Looks like you are not using ZSH, setting it as default shell"
chsh -s /bin/zsh
fi
echo "Pulling changes from dotfiles repo..."
git pull origin master;
function doIt() {
rsync --exclude ".git/" --exclude ".DS_Store" --exclude "link.sh" \
--exclude "README.md" --exclude "LICENSE-MIT.txt" -avh --no-perms . ~;
# It throws some errors, presumable because of $PATH
# source ~/.zshrc;
}
if [ "$1" == "--force" -o "$1" == "-f" ]; then
doIt;
else
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
echo "repl: '$REPLY'"
if [[ $REPLY =~ ^[Yy]$ ]]; then
doIt;
fi;
fi;
unset doIt;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment