You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 213f100
Browse filesBrowse the repository at this point in the historyBrowse files
Wire the update check into AppWiring and the subcommand lifecycle
Final piece of the periodic update-check feature: hooks the policy +
fetcher from the previous commits into the live CLI.
AppWiring:
- Adds `updateCheck: UpdateCheck` to the interface.
- DefaultAppWiring lazily constructs a `KtorReleaseFetcher` (kept open
for reuse between sibling commands) and the `UpdateCheck` instance.
The state file defaults to `~/.git-jaspr/update-check.json`.
- `close()` shuts the fetcher down only if it was actually used, so
commands that short-circuit the check pay zero cost.
Cli.kt:
- Adds `--no-update-check` global flag on GitJasprRoot. The flag binds
to the existing ChainedValueSource so users can also set
`update-check=false` in `~/.jaspr.properties`. Help text mentions the
properties key + env-var alternative.
- New `isUpdateCheckSkipped()` predicate composes all suppression
signals: the flag (or properties value), `JASPR_NO_UPDATE_CHECK` env
var, well-known CI env vars (CI, GITHUB_ACTIONS, GITLAB_CI, etc.),
and `System.console() == null` (non-TTY stdout). The predicate is
injected into AppWiring so the policy class can call it without
knowing about Clikt.
- GitJasprSubcommand: new `open val skipUpdateCheck: Boolean = false`
for subcommands that want to suppress the notice on a per-command
basis. `run()` calls `appWiring.updateCheck.maybeNotice()` after
doRun() succeeds and renders the result with `theme.muted`. The
rendering sits next to the existing "Tip:" line so the notice ends
up at the bottom of command output rather than competing with it.
UpdateCheck.kt:
- Adds `UpdateNotice.formatMessage()` so the wiring layer doesn't
hardcode the message format. Deliberately doesn't name a package
manager — jaspr ships via Homebrew, native-image, and source, so we
link to the GitHub release page and let it describe install methods.
Test: one new test covering `UpdateNotice.formatMessage()`. The 17
existing UpdateCheck tests + 5 fetcher tests still pass; full suite
runs clean (428 tests, 0 failures).
commit-id: If8fbb861
0 commit comments