1
0
mirror of https://git.decapod.one/brethil/dotfiles synced 2024-12-21 21:21:34 +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
if [[ -d "$HOME/.cache/antibody" ]]; then
# antibody migration cleanup
rm -rf $HOME/.cache/antibody
fi
( # main branch migration
set -euo pipefail
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
)
if [[ ! -d $DOTFILES/antidote ]]; then
git clone https://github.com/mattmc3/antidote.git ${DOTFILES}/antidote
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"
[[ -d $ZSH_CACHE_DIR ]] || mkdir -p $ZSH_CACHE_DIR/completions