mirror of
https://github.com/tw93/Mole.git
synced 2026-02-12 14:36:20 +00:00
Fix the optimized exit issue in Iterm2
This commit is contained in:
@@ -176,14 +176,23 @@ cleanup_path() {
|
|||||||
size_display=$(bytes_to_human "$((size_kb * 1024))")
|
size_display=$(bytes_to_human "$((size_kb * 1024))")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if rm -rf "$expanded_path"; then
|
local removed=false
|
||||||
|
if rm -rf "$expanded_path" 2> /dev/null; then
|
||||||
|
removed=true
|
||||||
|
elif request_sudo_access "Removing $label requires admin access"; then
|
||||||
|
if sudo rm -rf "$expanded_path" 2> /dev/null; then
|
||||||
|
removed=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$removed" == "true" ]]; then
|
||||||
if [[ -n "$size_display" ]]; then
|
if [[ -n "$size_display" ]]; then
|
||||||
echo -e "${GREEN}${ICON_SUCCESS}${NC} $label ${GREEN}(${size_display})${NC}"
|
echo -e "${GREEN}${ICON_SUCCESS}${NC} $label ${GREEN}(${size_display})${NC}"
|
||||||
else
|
else
|
||||||
echo -e "${GREEN}${ICON_SUCCESS}${NC} $label"
|
echo -e "${GREEN}${ICON_SUCCESS}${NC} $label"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo -e "${RED}${ICON_ERROR}${NC} Failed to remove $label"
|
echo -e "${YELLOW}${ICON_WARNING}${NC} Skipped $label ${GRAY}(grant Full Disk Access to your terminal and retry)${NC}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user