Last active
January 2, 2020 11:46
-
-
Save jechasteen/d7f49855510d0fb13e7689b6f29d695e to your computer and use it in GitHub Desktop.
A quick script to install my dot files
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
#!/usr/bin/env bash | |
# Credit to the tutorial found at | |
# https://www.atlassian.com/git/tutorials/dotfiles | |
config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' | |
git clone --bare https://github.com/jechasteen/dotfiles.git $HOME/.cfg && $config checkout | |
if [[ "$?" = 0 ]]; then | |
echo "Checked out dot files repo..." | |
else | |
echo "Backing up pre-existing dot files" | |
mkdir -p .config-backup | |
$config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{} | |
fi | |
$config checkout | |
$config config --local status.showUntrackedFiles no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment