1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-23 13:35:07 +00:00

🐛 Optimize uninstallation of mole

This commit is contained in:
Tw93
2025-10-07 10:58:08 +08:00
parent a3539532ae
commit dffe5bdb83

16
mole
View File

@@ -265,11 +265,6 @@ remove_mole() {
if [[ ${#manual_installs[@]} -gt 0 ]]; then
for install in "${manual_installs[@]}"; do
echo -e " ${GREEN}✓${NC} $install"
local install_dir="$(dirname "$install")"
local install_root="$(dirname "$install_dir")"
if [[ -d "$install_root/lib" ]]; then
echo -e " ${GREEN}✓${NC} $install_root/lib/"
fi
done
fi
@@ -322,17 +317,6 @@ remove_mole() {
log_error "Failed to remove $install (try with sudo)"
fi
fi
# Remove lib directory if it exists
local install_dir="$(dirname "$install")"
local install_root="$(dirname "$install_dir")"
if [[ -d "$install_root/lib" ]]; then
if rm -rf "$install_root/lib" 2>/dev/null; then
log_success "Removed library files from $install_root"
else
log_warning "Could not remove $install_root/lib (may need sudo)"
fi
fi
done
fi