Skip to main content

maybe_auto_update

Function maybe_auto_update 

Source
pub fn maybe_auto_update(registry: &Registry)
Expand description

The end-of-run hook behind auto_update: when the setting is on and the last release check already knows a newer version exists, replace the binary without being asked.

Warn-never-fail, like everything else that runs as a side effect of devp run — a broken upgrade path must not turn a successful prune into a failed command.

Deliberately not run_install. That function falls back to running the package manager that installed this copy, and this is the path that runs unattended: from the scheduled pass, from a git hook, from devp run in the middle of someone else’s work. Spawning winget upgrade there can raise an elevation prompt and can pull in upgrades nobody asked about. Download-and-replace is safe unattended; handing the machine to a package manager is a decision, and decisions stay with the person.