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