Format and link version mismatch warning

This commit is contained in:
Félix Saparelli 2022-05-31 23:51:01 +12:00
parent aa4339e07d
commit 529781a9a9
No known key found for this signature in database
GPG key ID: B948C4BAE44FC474
2 changed files with 40 additions and 15 deletions

View file

@ -173,9 +173,13 @@ async fn entry() -> Result<()> {
let is_plain_version = semver::Version::from_str(&opts.version).is_ok();
if is_plain_version && package.version != opts.version {
warn!(
"You specified `--version {o}` but the package resolved that to '{p}', use `={o}` if you want an exact match",
o=opts.version, p=package.version
warn!("Warning!");
eprintln!(
"{:?}",
miette::Report::new(BinstallError::VersionWarning {
ver: package.version.clone(),
req: opts.version.clone()
})
);
if !opts.no_confirm && !opts.dry_run {