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

fix(clean): improve loading feedback and spinner output

This commit is contained in:
tw93
2026-02-26 16:36:06 +08:00
parent b3f023b5e6
commit aa1a436862
4 changed files with 69 additions and 5 deletions

View File

@@ -7,7 +7,17 @@ clean_tool_cache() {
local description="$1"
shift
if [[ "$DRY_RUN" != "true" ]]; then
local command_succeeded=false
if [[ -t 1 ]]; then
start_section_spinner "Cleaning $description..."
fi
if "$@" > /dev/null 2>&1; then
command_succeeded=true
fi
if [[ -t 1 ]]; then
stop_section_spinner
fi
if [[ "$command_succeeded" == "true" ]]; then
echo -e " ${GREEN}${ICON_SUCCESS}${NC} $description"
fi
else