Skip to content

Commit

Permalink
fix(upgrade): Highlight when new req isn't on latest
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Jul 27, 2022
1 parent c99ffe3 commit 4c0e69e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/bin/upgrade/upgrade.rs
Expand Up @@ -475,6 +475,17 @@ impl Dep {
spec.set_fg(Some(Color::Yellow));
} else if self.new_version_req != self.old_version_req {
spec.set_fg(Some(Color::Green));
if let Some(latest_version) = self
.latest_version
.as_ref()
.and_then(|v| semver::Version::parse(v).ok())
{
if let Ok(new_version_req) = semver::VersionReq::parse(&self.new_version_req) {
if !new_version_req.matches(&latest_version) {
spec.set_fg(Some(Color::Yellow));
}
}
}
}
spec
}
Expand Down

0 comments on commit 4c0e69e

Please sign in to comment.