Check for a newer git-task-web on start, add web upgrade - #8
Merged
Conversation
start now compares the installed git-task-web against npm's latest (via the same npm binary install already shells out to, no new HTTP client dependency) once it's confirmed installed, and offers to upgrade — --yes/non-interactive/--format json all skip the prompt and just start on the current version, surfacing a warning instead. New `git task web upgrade` subcommand: installs the latest version, stopping and restarting the server around it if one is running so the new version actually takes effect. Works from a clean slate too (nothing installed yet -> plain install). GTASK-2d979d10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
git task web startnow checks npm for a newer git-task-web once it confirms one is installed, and offers to upgrade before starting.--yes/non-interactive/--format jsonall skip the interactive prompt and start on the current version, surfacing a warning instead of blocking.git task web upgradesubcommand: installs the latest version, stopping and restarting the server around it if one's running so the new version actually takes effect. Also works as a plain install if nothing's installed yet.npmshell-out (install::installalready does this) rather than adding an HTTP client dependency —npm view git-task-web versionfor latest, the installed package's ownpackage.jsonfor current. Any lookup failure (offline, npm down) is treated as "nothing to report," never blocks start/upgrade.Test plan
cargo buildcargo test(100 lib tests + all integration tests pass, including newweb::updateunit tests)git task web upgradeon a genuinely outdated local install (0.1.1 -> 0.1.3) stopped the running server, upgraded, and restarted it--format jsonprints exactly one envelope for bothstartandupgrade(including the restart-after-upgrade path)warnings[], without blocking start