Last active
May 19, 2024 19:30
-
-
Save itatabitovski/0ff595d648012827d378c6ffe7be0fee to your computer and use it in GitHub Desktop.
Bootstraping dotfiles on a fresh installation
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
#!/bin/bash | |
mkdir ~/src | |
git clone --bare https://github.com/itatabitovski/dotfiles.git $HOME/src/dotfiles | |
alias dotfiles="/usr/bin/git --git-dir=$HOME/src/dotfiles --work-tree=$HOME" | |
dotfiles checkout | |
if [ $? = 0 ]; then | |
echo "Checked out config."; | |
else | |
echo "Backing up pre-existing dot files."; | |
mkdir ~/.dotfiles-backup | |
dotfiles checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .dotfiles-backup/{} | |
fi; | |
dotfiles checkout | |
dotfiles config status.showUntrackedFiles no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment