From dc1c799b988da2a748280402151eb17e61967bdc Mon Sep 17 00:00:00 2001 From: Qiufeng Date: Thu, 27 Aug 2026 23:51:56 +0800 Subject: [PATCH] fix: keep source checkout on non-purge uninstall --- deploy/uninstall.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/deploy/uninstall.sh b/deploy/uninstall.sh index c88f7c4..4faffa6 100755 --- a/deploy/uninstall.sh +++ b/deploy/uninstall.sh @@ -39,8 +39,11 @@ for plugin in "${PLUGINS[@]}"; do unit="sub2api-$plugin.service" systemctl disable --now "$unit" 2>/dev/null || true rm -f "/etc/systemd/system/$unit" - rm -rf "$PREFIX/$plugin" + # Keep the checked-out source clean so a later install can fast-forward it. + # Only generated binaries are removed unless --purge is explicitly used. + rm -f "$PREFIX/$plugin/bin/$plugin" if $PURGE; then + rm -rf "$PREFIX/$plugin" rm -f "$ETC_DIR/$plugin.env" rm -rf "$VAR_DIR/$plugin" fi