Fix uninstall.sh: retry with sudo when rm -rf fails on Docker-owned files
Nightly Build / build (push) Successful in 6m26s
Nightly Build / build (push) Successful in 6m26s
homes/ directory can contain files owned by other UIDs (root, etc.) because Docker containers run as different users. Normal rm -rf fails with Permission denied. Now falls back to sudo rm -rf automatically.
This commit is contained in:
+10
-1
@@ -97,7 +97,16 @@ esac
|
||||
# ── Remove installation directory ─────────────────────────────────────────────
|
||||
if [ -d "$INSTALL_DIR" ]; then
|
||||
info "🗑️ Removing installation directory …"
|
||||
rm -rf "$INSTALL_DIR"
|
||||
rm -rf "$INSTALL_DIR" 2>/dev/null || {
|
||||
warn "Some files are owned by other users (e.g. from Docker sandboxes)."
|
||||
info "🔐 Retrying with sudo …"
|
||||
sudo rm -rf "$INSTALL_DIR"
|
||||
}
|
||||
if [ -d "$INSTALL_DIR" ]; then
|
||||
err "Failed to remove ${INSTALL_DIR} even with sudo."
|
||||
err "You may need to manually remove it."
|
||||
exit 1
|
||||
fi
|
||||
info "✔ Removed ${INSTALL_DIR}"
|
||||
else
|
||||
warn "Installation directory not found: ${INSTALL_DIR}"
|
||||
|
||||
Reference in New Issue
Block a user