MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / record_previous_version

Function record_previous_version

src/upgrade.rs:701–714  ·  view source on GitHub ↗

Record the *currently running* binary's version in user config just before the binary is replaced. The new binary reads this on startup as `previous_version` and decides whether reinstall is required for the transition (e.g. minor/major bumps re-register agents to pick up new MCP tools or hook changes; patch bumps just update the field).

()

Source from the content-addressed store, hash-verified

699/// transition (e.g. minor/major bumps re-register agents to pick up new MCP
700/// tools or hook changes; patch bumps just update the field).
701fn record_previous_version() {
702 let current = env!("CARGO_PKG_VERSION");
703 let mut cfg = UserConfig::load();
704 if cfg.previous_version == current {
705 return;
706 }
707 cfg.previous_version = current.to_string();
708 if !cfg.save() {
709 eprintln!(
710 " \x1b[33mwarning:\x1b[0m could not record previous version; \
711 run `tracedecay reinstall` manually if new tools aren't registered"
712 );
713 }
714}
715
716/// Returns the path the new binary was installed at, when known.
717fn perform_upgrade(

Callers 3

run_versioned_upgradeFunction · 0.85
run_brew_upgradeFunction · 0.85
switch_channelFunction · 0.85

Calls 2

loadFunction · 0.50
saveMethod · 0.45

Tested by

no test coverage detected