Skip to content

Instantly share code, notes, and snippets.

@blacksails
Last active February 15, 2022 11:53
Show Gist options
  • Save blacksails/c339bc40b53829b1676a6992e3d30d95 to your computer and use it in GitHub Desktop.
Save blacksails/c339bc40b53829b1676a6992e3d30d95 to your computer and use it in GitHub Desktop.
function dotfiles {
/usr/bin/git --git-dir=$HOME/.files/ --work-tree=$HOME $@
}
git clone --bare https://github.com/blacksails/dotfiles.git $HOME/.files
dotfiles checkout
if [ $? = 0 ]
then
echo "Checked out dotfiles."
else
echo "Backing up pre-existing dotfiles.";
dotfiles checkout 2>&1 | egrep "^\s+" | awk {'print $1'} | xargs -I% sh -c 'mkdir -p .dotfiles-backup/`dirname %`; mv % .dotfiles-backup/%'
fi
dotfiles checkout
dotfiles config status.showUntrackedFiles no
dotfiles submodule update --init --recursive
export ZDOTDIR=$HOME/.config/zsh
source ~/.config/zsh/.zshrc
zplug install
source ~/.config/zsh/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment