mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-07 20:50:03 +00:00
Format and link version mismatch warning
This commit is contained in:
parent
aa4339e07d
commit
529781a9a9
2 changed files with 40 additions and 15 deletions
10
src/main.rs
10
src/main.rs
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue