Last active
December 14, 2017 13:29
-
-
Save pinpox/caa345c5d89fe9f4780bf3a4a4d5b072 to your computer and use it in GitHub Desktop.
Setup environment on a new system
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_REPO="https://gitlab.com/binaryplease/dotfiles.git" | |
git clone --bare $GIT_REPO $HOME/.cfg | |
function config { | |
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@ | |
} | |
echo ".cfg" >> .gitignore | |
mkdir -p .config-backup | |
config checkout | |
if [ $? = 0 ]; then | |
echo "Checked out config2."; | |
else | |
echo "Backing up pre-existing dot files."; | |
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{} | |
fi; | |
config checkout | |
config config status.showUntrackedFiles no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment