Last active
April 21, 2022 05:52
-
-
Save crashbell/c282e2a865cb615b200e1adc56e1989f to your computer and use it in GitHub Desktop.
Install dotfile curl -Lks http://bit.do/crashbell-cfg-install | /bin/bash
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
| rm -rf $HOME/.cfg | |
| git clone --bare [email protected]:crashbell/dotfiles.git $HOME/.cfg | |
| function config { | |
| /usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME $@ | |
| } | |
| move_backup () { | |
| echo "Moving backup files"; | |
| mkdir --parents "$(dirname "$1")"; | |
| mv -f "$1" "$2"; | |
| } | |
| mkdir -p .config-backup | |
| config fetch --all | |
| config checkout | |
| if [ $? = 0 ]; then | |
| echo "Checked out config."; | |
| else | |
| echo "Backing up pre-existing dot files."; | |
| config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} sh -c 'mkdir -pv $(dirname .config-backup/{})' | |
| config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv -f {} .config-backup/{} | |
| echo "Done backup"; | |
| fi; | |
| config checkout | |
| config config status.showUntrackedFiles no | |
| echo "Installation has been completed"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment