fix: install ohmyzsh only if haven't

This commit is contained in:
Yingjie Wang 2024-08-25 10:39:27 -04:00
parent 0c738fdb67
commit f176886688

View File

@ -7,7 +7,9 @@ echo "Please select the zsh plugin manager:"
zsh_manager=$(gum choose --limit=1 --cursor-prefix "( ) " --selected-prefix "(x) " --unselected-prefix "( ) " "oh my zsh" "zinit") zsh_manager=$(gum choose --limit=1 --cursor-prefix "( ) " --selected-prefix "(x) " --unselected-prefix "( ) " "oh my zsh" "zinit")
if [[ "${zsh_manager}" == *"oh my zsh"* ]]; then if [[ "${zsh_manager}" == *"oh my zsh"* ]]; then
source .install/install-packages.sh source .install/install-packages.sh
RUNZSH=no CHSH=no sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" if [ ! -d ~/.oh-my-zsh ]; then
RUNZSH=no CHSH=no sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
fi
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting git clone https://github.com/zdharma-continuum/fast-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/fast-syntax-highlighting