1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-12-22 13:41:40 +01:00

zsh: add master->main dotfiles migration

This commit is contained in:
bretello 2024-07-07 20:27:03 +02:00
parent 28b1d9e2f7
commit 6d67506b9f
Signed by: brethil
GPG Key ID: 876AAC6290170FE7

View File

@ -9,15 +9,29 @@ export VIRTUAL_ENV_DISABLE_PROMPT=true
export PATH=$PATH:$HOME/bin export PATH=$PATH:$HOME/bin
if [[ -d "$HOME/.cache/antibody" ]]; then ( # main branch migration
# antibody migration cleanup set -euo pipefail
rm -rf $HOME/.cache/antibody cd $DOTFILES
if [[ $(git branch --show-current) == "master" ]]; then
echo "Migrating to main branch..."
git fetch
git stash
git switch main
git stash pop
git branch -D master
echo "Migration done!"
fi fi
)
if [[ ! -d $DOTFILES/antidote ]]; then if [[ ! -d $DOTFILES/antidote ]]; then
git clone https://github.com/mattmc3/antidote.git ${DOTFILES}/antidote git clone https://github.com/mattmc3/antidote.git ${DOTFILES}/antidote
fi fi
if [[ -d "$HOME/.cache/antibody" ]]; then
# antibody migration cleanup
rm -rf $HOME/.cache/antibody
fi
export ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/oh-my-zsh" export ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/oh-my-zsh"
[[ -d $ZSH_CACHE_DIR ]] || mkdir -p $ZSH_CACHE_DIR/completions [[ -d $ZSH_CACHE_DIR ]] || mkdir -p $ZSH_CACHE_DIR/completions