From 34c5b438eb34ca885a04edf2bc4a4d8337e0438d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=20Villase=C3=B1or=20Montfort?= <195970+montfort@users.noreply.github.com> Date: Thu, 19 Mar 2026 07:56:38 -0600 Subject: [PATCH] fix: skip framework download when already at latest version Add semver comparison in update-framework to match the pattern already used by update-cli in self_update.rs. Without this, every `devtrail update` re-downloads and overwrites all 65 framework files even when the installed version matches the latest release. Co-Authored-By: Claude Opus 4.6 (1M context) --- cli/src/commands/update_framework.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/cli/src/commands/update_framework.rs b/cli/src/commands/update_framework.rs index 9f14bb1..0cfd008 100644 --- a/cli/src/commands/update_framework.rs +++ b/cli/src/commands/update_framework.rs @@ -42,6 +42,24 @@ pub fn run() -> Result<()> { display_version.green() ); + // Compare versions — skip if already up to date + let current_ver_str = download::strip_tag_prefix(¤t_checksums.version); + if !current_ver_str.is_empty() { + if let (Ok(current), Ok(latest)) = ( + semver::Version::parse(current_ver_str), + semver::Version::parse(display_version), + ) { + if latest <= current { + println!(); + utils::success(&format!( + "Framework is already at the latest version ({})", + current_checksums.version + )); + return Ok(()); + } + } + } + // Download ZIP let temp_dir = tempfile::tempdir().context("Failed to create temp directory")?; let zip_path = temp_dir.path().join("devtrail.zip");