Update oh-my-zsh.sh

This commit is contained in:
UnaTried 2025-04-02 18:41:33 +02:00 committed by GitHub
commit 68957c63d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -218,6 +218,11 @@ is_theme() {
builtin test -f $base_dir/$name.zsh-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 [[ -n "$ZSH_THEME" ]]; then
if is_theme "$ZSH_CUSTOM" "$ZSH_THEME"; then if is_theme "$ZSH_CUSTOM" "$ZSH_THEME"; then
source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme" source "$ZSH_CUSTOM/$ZSH_THEME.zsh-theme"
@ -227,11 +232,11 @@ if [[ -n "$ZSH_THEME" ]]; then
source "$ZSH/themes/$ZSH_THEME.zsh-theme" source "$ZSH/themes/$ZSH_THEME.zsh-theme"
else else
echo "[oh-my-zsh] Theme '$ZSH_THEME' was not found, using default theme!" 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" 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" 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" source "$ZSH/themes/robbyrussell.zsh-theme"
else else
echo "oh-my-zsh] The default theme (robbyrussell) was not found, redownloading it!" echo "oh-my-zsh] The default theme (robbyrussell) was not found, redownloading it!"