Last active
October 1, 2021 07:56
-
-
Save dixiedream/8adbb2a5e526832757b6e8f03fff36c2 to your computer and use it in GitHub Desktop.
Download Dotfiles
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
#!/bin/sh | |
set -e | |
# Download and setup my dotfiles, repo overriding possible just pass your repo as first argument | |
repo=${1:-https://github.com/dixiedream/dotfiles.git} | |
git clone --bare "$repo" "$HOME/.cfg" | |
function config { | |
/usr/bin/git --git-dir="$HOME/.cfg/" --work-tree="$HOME" $@ | |
} | |
rm -rf .config | |
#mkdir -p .config-backup | |
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{} mv {} .config-backup/{} | |
#fi; | |
config checkout | |
config config status.showUntrackedFiles no |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment