Last active
April 9, 2023 13:16
-
-
Save EduardoRodriguesF/600ed2f94ad4bdba947fbdf0ca698a9e to your computer and use it in GitHub Desktop.
Install my Dotfiles
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 | |
git clone --bare https://github.com/EduardoRodriguesF/dotfiles $HOME/.dotfiles | |
function dotfiles { | |
/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME $@ | |
} | |
dotfiles checkout | |
if [ $? = 0 ]; then | |
echo "Checked out dotfiles."; | |
else | |
echo "Backing up pre-existing dot files."; | |
mkdir -p .dotfiles-backup | |
dotfiles checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .dotfiles-backup/{} | |
fi; | |
dotfiles checkout | |
dotfiles submodule init | |
dotfiles submodule update | |
dotfiles config status.showUntrackedFiles no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment