Created
April 8, 2017 22:55
-
-
Save runk/484147001583b35a19c432c855974351 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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