Last active
April 21, 2022 05:52
-
-
Save crashbell/c282e2a865cb615b200e1adc56e1989f to your computer and use it in GitHub Desktop.
Revisions
-
crashbell revised this gist
May 6, 2017 . No changes.There are no files selected for viewing
-
crashbell revised this gist
May 6, 2017 . No changes.There are no files selected for viewing
-
crashbell revised this gist
May 6, 2017 . No changes.There are no files selected for viewing
-
crashbell created this gist
May 6, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ 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";