Last active
May 19, 2017 01:22
-
-
Save ErichDonGubler/e0f5a2ba8848a63dc3a9ec1ef5a72c46 to your computer and use it in GitHub Desktop.
A Bash script that sets up erichdongubler's dotfiles repo locally and deploys immediately
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
# Shamelessly copied and adapted from https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/ | |
pushd "$HOME" > /dev/null | |
git clone --bare https://github.com/ErichDonGubler/.dotfiles.git ~/.dotfiles.git | |
function .git() { | |
git --git-dir="$HOME/.dotfiles.git/" --work-tree="$HOME" $* | |
} | |
.git checkout | |
if [ $? = 0 ]; then | |
echo "Checked out dotfiles."; | |
else | |
echo "Backing up pre-existing dot files."; | |
mkdir -p .dotfiles-backup | |
.git checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .dotfiles-backup/{} | |
fi; | |
.git checkout | |
.git config status.showUntrackedFiles no | |
echo 'Sourcing ~/.bashrc...' | |
. ~/.bashrc | |
echo "Downloading submodules (if any)..." | |
.git up | |
echo "Installing vim plugins..." | |
mkdir -p ~/.vim/.{swapfiles,backups} | |
vim +PlugInstall +qall | |
echo "Installing TPM plugins..." | |
git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm && ~/.tmux/plugins/tpm/bin/install_plugins | |
popd > /dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment