-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
5 additions
and
11 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,16 @@ | ||
#!/bin/sh | ||
# Origin https://bitbucket.org/durdn/cfg/src/master/.bin/install.sh | ||
# Inspiration https://bitbucket.org/durdn/cfg/src/master/.bin/install.sh | ||
|
||
cd "$HOME" | ||
|
||
alias cfg="/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME" | ||
mkdir -p "$HOME/.config-backup" | ||
git clone --bare https://github.com/dhvcc/configs.git $HOME/.cfg | ||
git clone --no-checkout --bare https://github.com/dhvcc/configs.git $HOME/.cfg | ||
|
||
cfg checkout | ||
# Backup and remove repo files (if exist) | ||
cfg ls-tree -r master --name-only | xargs -I {} mv {} ./.config-backup/{} | ||
|
||
if [ $? = 0 ]; then | ||
echo "Checked out config."; | ||
else | ||
echo "Backing up pre-existing dot files."; | ||
cfg checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | xargs -I{} mv {} .config-backup/{} | ||
cfg checkout | ||
fi; | ||
cfg checkout | ||
|
||
cfg "config" status.showUntrackedFiles no | ||
cfg "config" commit.verbose true |