fix(setup): prevent offline bootstrap from intercepting sync/backup/restore subcommands

The try_bootstrap_from_offline_package call at line 2138 ran before subcommand
routing (sync/backup/restore/migrate/uninstall) at line 2357+, causing those
subcommands to be silently consumed by the offline bootstrap early-exit path.

Added a case guard to skip the offline bootstrap when a recognized subcommand
is provided as $1.
This commit is contained in:
Haitao Pan 2026-06-17 19:59:49 +08:00
parent e2b9c91672
commit c54bf37113

View File

@ -2135,9 +2135,15 @@ if [ "$OS_NAME" = "linux" ]; then
acquire_deployment_lock
wait_for_apt_locks
ensure_public_edge_firewall_ports
if try_bootstrap_from_offline_package; then
exit 0
fi
# Skip offline bootstrap when running a subcommand that handles its own flow
case "${1:-}" in
sync|uninstall|backup|restore|migrate) ;;
*)
if try_bootstrap_from_offline_package; then
exit 0
fi
;;
esac
fi
if ! command -v ansible-playbook >/dev/null 2>&1 || ! command -v git >/dev/null 2>&1; then