Created
July 25, 2017 02:14
-
-
Save fu5ha/24fc565d287d0657cab68bbbb416816c to your computer and use it in GitHub Desktop.
Checkout my config files into home directory
This file contains 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 | |
curl -sSL https://get.oh-my.fish/ | fish | |
rm -rf $HOME/.config/omf | |
git clone --bare https://github.com/termhn/dotfiles $HOME/.dotfiles | |
function dotfiles { | |
/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@ | |
} | |
mkdir -p .config-backup | |
dotfiles checkout | |
if [ $? = 0 ]; then | |
echo "Checked out config."; | |
else | |
echo "Backing up pre-existing dot files."; | |
dotfiles checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{} | |
fi; | |
dotfiles checkout | |
dotfiles config status.showUntrackedFiles no | |
echo "Checked out config."; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment