1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 18:30:08 +00:00

refactor(ui): unify action and list hints across commands

This commit is contained in:
tw93
2026-02-23 11:34:22 +08:00
parent 3112673ed3
commit 4c9a71315f
5 changed files with 36 additions and 35 deletions

View File

@@ -56,9 +56,9 @@ manage_purge_paths() {
for path in "${PURGE_SEARCH_PATHS[@]}"; do
local display_path="${path/#$HOME/~}"
if [[ -d "$path" ]]; then
echo -e " ${GREEN}${NC} $display_path"
echo -e " ${GREEN}${ICON_SUCCESS}${NC} $display_path"
else
echo -e " ${GRAY}${NC} $display_path${GRAY}, not found${NC}"
echo -e " ${GRAY}${ICON_EMPTY}${NC} $display_path${GRAY}, not found${NC}"
fi
done
fi

View File

@@ -25,7 +25,7 @@ format_brew_update_label() {
printf '%s' "${details[*]}"
)"
fi
printf " Homebrew%s" "$detail_str"
printf " %s Homebrew%s" "$ICON_LIST" "$detail_str"
}
brew_has_outdated() {
@@ -54,17 +54,17 @@ ask_for_updates() {
if [[ -n "${APPSTORE_UPDATE_COUNT:-}" && "${APPSTORE_UPDATE_COUNT:-0}" -gt 0 ]]; then
has_updates=true
update_list+=(" App Store, ${APPSTORE_UPDATE_COUNT} apps")
update_list+=(" ${ICON_LIST} App Store, ${APPSTORE_UPDATE_COUNT} apps")
fi
if [[ -n "${MACOS_UPDATE_AVAILABLE:-}" && "${MACOS_UPDATE_AVAILABLE}" == "true" ]]; then
has_updates=true
update_list+=(" macOS system")
update_list+=(" ${ICON_LIST} macOS system")
fi
if [[ -n "${MOLE_UPDATE_AVAILABLE:-}" && "${MOLE_UPDATE_AVAILABLE}" == "true" ]]; then
has_updates=true
update_list+=(" Mole")
update_list+=(" ${ICON_LIST} Mole")
fi
if [[ "$has_updates" == "false" ]]; then
@@ -96,7 +96,7 @@ ask_for_updates() {
fi
echo ""
echo -e "${YELLOW}💡 Run ${GREEN}brew upgrade${YELLOW} to update${NC}"
echo -e "${ICON_REVIEW} Run ${GREEN}brew upgrade${NC} to update"
return 1
}
@@ -115,7 +115,7 @@ perform_updates() {
if [[ -x "$mole_bin" ]]; then
if "$mole_bin" update 2>&1 | grep -qE "(Updated|latest version)"; then
echo -e "${GREEN}${NC} Mole updated"
echo -e "${GREEN}${ICON_SUCCESS}${NC} Mole updated"
reset_mole_cache
((updated_count++))
else