mirror of
https://github.com/basecamp/omarchy.git
synced 2026-02-17 15:25:37 +00:00
Fix migration for when current theme is a directory, not a symlink
Closes #4147
This commit is contained in:
@@ -45,10 +45,12 @@ fi
|
|||||||
THEMES_DIR="$HOME/.config/omarchy/themes"
|
THEMES_DIR="$HOME/.config/omarchy/themes"
|
||||||
CURRENT_THEME_LINK="$HOME/.config/omarchy/current/theme"
|
CURRENT_THEME_LINK="$HOME/.config/omarchy/current/theme"
|
||||||
|
|
||||||
# Get current theme name from symlink before removing anything
|
# Get current theme name before removing anything
|
||||||
CURRENT_THEME_NAME=""
|
CURRENT_THEME_NAME=""
|
||||||
if [[ -L $CURRENT_THEME_LINK ]]; then
|
if [[ -L $CURRENT_THEME_LINK ]]; then
|
||||||
CURRENT_THEME_NAME=$(basename "$(readlink "$CURRENT_THEME_LINK")")
|
CURRENT_THEME_NAME=$(basename "$(readlink "$CURRENT_THEME_LINK")")
|
||||||
|
elif [[ -d $CURRENT_THEME_LINK ]]; then
|
||||||
|
CURRENT_THEME_NAME=$(basename "$CURRENT_THEME_LINK")
|
||||||
elif [[ -f "$HOME/.config/omarchy/current/theme.name" ]]; then
|
elif [[ -f "$HOME/.config/omarchy/current/theme.name" ]]; then
|
||||||
CURRENT_THEME_NAME=$(cat "$HOME/.config/omarchy/current/theme.name")
|
CURRENT_THEME_NAME=$(cat "$HOME/.config/omarchy/current/theme.name")
|
||||||
fi
|
fi
|
||||||
@@ -59,4 +61,7 @@ find "$THEMES_DIR" -mindepth 1 -maxdepth 1 -type l -delete
|
|||||||
# Re-apply the current theme with the new system
|
# Re-apply the current theme with the new system
|
||||||
if [[ -n $CURRENT_THEME_NAME ]]; then
|
if [[ -n $CURRENT_THEME_NAME ]]; then
|
||||||
omarchy-theme-set "$CURRENT_THEME_NAME"
|
omarchy-theme-set "$CURRENT_THEME_NAME"
|
||||||
|
else
|
||||||
|
# Backup to ensure a theme is set if we can't deduce the name
|
||||||
|
omarchy-theme-set "Tokyo Night"
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user