Last active
November 18, 2018 05:07
-
-
Save jmcker/f9ed4121dad42c3203b103c0d0f1369b 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/ | |
git clone --bare https://github.com/jmcker/.cfg.git $HOME/.cfg | |
function cfg { | |
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@ | |
} | |
mkdir -p .cfg-backup | |
cfg checkout | |
if [ $? = 0 ]; then | |
echo "Checked out config."; | |
else | |
echo "Backing up existing dot files."; | |
cfg checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .cfg-backup/{} | |
fi; | |
cfg checkout | |
cfg config status.showUntrackedFiles no | |
if [ -f $HOME/.bashrc ]; then | |
source $HOME/.bashrc | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment