Add a self-update command #6

Closed
opened 2026-11-16 03:00:52 +00:00 by aaron · 0 comments
Owner

Problem

Updating tntop requires users to download a release, verify it and replace the installed binary by hand.

Change

Add tntop self-update to download and install the latest stable release for the current operating system and CPU architecture.

Done when

  • The command checks releases on the project’s Forgejo instance and skips drafts and prereleases.
  • It reports the installed and available versions. If the installed version is current or newer, it exits without replacing the binary.
  • It selects the matching release asset and verifies its SHA-256 checksum before installing.
  • It updates the installed executable on macOS, Linux and Windows, including Windows handling for replacing a running executable.
  • Download, verification or replacement failures leave the existing installation usable and report a clear error.
  • Missing assets, unsupported platforms and insufficient permissions produce clear errors without requesting elevated access automatically.
  • The update preserves configuration and stored API keys.
  • The command reports the installed version after a successful update.
  • Help text and the README explain how to update.
  • Tests cover version selection, asset selection, checksum failures and safe replacement.

#4 adds an installation script. Keep release selection, asset names and checksum handling consistent between installation and self-update.

## Problem Updating tntop requires users to download a release, verify it and replace the installed binary by hand. ## Change Add `tntop self-update` to download and install the latest stable release for the current operating system and CPU architecture. ## Done when - The command checks releases on the project’s Forgejo instance and skips drafts and prereleases. - It reports the installed and available versions. If the installed version is current or newer, it exits without replacing the binary. - It selects the matching release asset and verifies its SHA-256 checksum before installing. - It updates the installed executable on macOS, Linux and Windows, including Windows handling for replacing a running executable. - Download, verification or replacement failures leave the existing installation usable and report a clear error. - Missing assets, unsupported platforms and insufficient permissions produce clear errors without requesting elevated access automatically. - The update preserves configuration and stored API keys. - The command reports the installed version after a successful update. - Help text and the README explain how to update. - Tests cover version selection, asset selection, checksum failures and safe replacement. ## Related #4 adds an installation script. Keep release selection, asset names and checksum handling consistent between installation and self-update.
aaron added this to the v0.2.0 milestone 2026-11-16 14:41:41 +00:00
aaron closed this issue 2026-11-16 17:21:14 +00:00
Sign in to join this conversation.
No description provided.