fix(get.sh): refresh installer files before uninstall

The uninstall shortcut was executing the stale on-disk uninstall.sh
without refreshing it first, unlike the upgrade path. This meant fixes
to uninstall.sh were never picked up by existing installations.
Refresh all installer files before exec-ing uninstall.sh.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
amir-climy 2026-05-19 19:58:02 +08:00
parent d67086ccd8
commit e2265c2d89

9
get.sh
View file

@ -75,8 +75,15 @@ if [[ $UNINSTALL -eq 1 ]]; then
if [[ "$PLATFORM" == "linux" && $EUID -ne 0 ]]; then
die "run as root on Linux:\n\n curl -fsSL https://raw.githubusercontent.com/primatekuntech/triton-install/main/get.sh | sudo bash -s -- --uninstall"
fi
[[ -f "${INSTALL_DIR}/uninstall.sh" ]] \
[[ -d "$INSTALL_DIR" ]] \
|| die "Triton Manage Server does not appear to be installed (${INSTALL_DIR} not found)"
info "refreshing installer files..."
for f in "${INSTALLER_FILES[@]}"; do
curl -fsSL "${REPO_BASE}/${f}" -o "${INSTALL_DIR}/${f}"
done
chmod +x "${INSTALL_DIR}/install.sh" "${INSTALL_DIR}/upgrade.sh" "${INSTALL_DIR}/uninstall.sh"
ok "installer files refreshed"
echo ""
exec bash "${INSTALL_DIR}/uninstall.sh" "${PASSTHROUGH[@]}"
fi