From 68957c63d0ea18316b8e37676b36e0397b1e3ea1 Mon Sep 17 00:00:00 2001 From: UnaTried <103455203+UnaTried@users.noreply.github.com> Date: Wed, 2 Apr 2025 18:41:33 +0200 Subject: [PATCH] Update oh-my-zsh.sh --- oh-my-zsh.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/oh-my-zsh.sh b/oh-my-zsh.sh index dd2f26492..5f9a56954 100644 --- a/oh-my-zsh.sh +++ b/oh-my-zsh.sh @@ -218,6 +218,11 @@ is_theme() { builtin test -f $base_dir/$name.zsh-theme } +is_default_theme() { + local base_dir=$1 + builtin test -f $base_dir +} + if [[ -n "$ZSH_THEME" ]]; then if is_theme "$ZSH_CUSTOM" "$ZSH_THEME"; then source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" @@ -227,11 +232,11 @@ if [[ -n "$ZSH_THEME" ]]; then source "$ZSH/themes/$ZSH_THEME.zsh-theme" else echo "[oh-my-zsh] Theme '$ZSH_THEME' was not found, using default theme!" - if is_theme "$ZSH_CUSTOM"; then + if is_default_theme "$ZSH_CUSTOM"; then source "$ZSH_CUSTOM/robbyrussell.zsh-theme" - elif is_theme "$ZSH_CUSTOM/themes"; then + elif is_default_theme "$ZSH_CUSTOM/themes"; then source "$ZSH_CUSTOM/themes/robbyrussell.zsh-theme" - elif is_theme "$ZSH/themes"; then + elif is_default_theme "$ZSH/themes"; then source "$ZSH/themes/robbyrussell.zsh-theme" else echo "oh-my-zsh] The default theme (robbyrussell) was not found, redownloading it!"