diff options
Diffstat (limited to 'crates/shirabe/src/command')
| -rw-r--r-- | crates/shirabe/src/command/create_project_command.rs | 5 | ||||
| -rw-r--r-- | crates/shirabe/src/command/licenses_command.rs | 18 | ||||
| -rw-r--r-- | crates/shirabe/src/command/show_command.rs | 29 |
3 files changed, 29 insertions, 23 deletions
diff --git a/crates/shirabe/src/command/create_project_command.rs b/crates/shirabe/src/command/create_project_command.rs index efbfd44..1667ac1 100644 --- a/crates/shirabe/src/command/create_project_command.rs +++ b/crates/shirabe/src/command/create_project_command.rs @@ -895,10 +895,7 @@ impl CreateProjectCommand { io.write_error(&format!( "<info>Installing {} ({})</info>", package.get_name(), - package.get_full_pretty_version( - false, - <dyn crate::package::PackageInterface>::DISPLAY_SOURCE_REF_IF_DEV - ) + package.get_full_pretty_version(false, crate::package::DisplayMode::SourceRefIfDev) )); if disable_plugins { diff --git a/crates/shirabe/src/command/licenses_command.rs b/crates/shirabe/src/command/licenses_command.rs index 681ac7a..ddd7d3d 100644 --- a/crates/shirabe/src/command/licenses_command.rs +++ b/crates/shirabe/src/command/licenses_command.rs @@ -19,7 +19,6 @@ use crate::json::JsonFile; use crate::package::BasePackage; use crate::package::CompletePackage; use crate::package::CompletePackageInterface; -use crate::package::PackageInterface; use crate::plugin::CommandEvent; use crate::plugin::PluginEvents; use crate::repository::CanonicalPackagesTrait; @@ -178,14 +177,10 @@ impl LicensesCommand { }; table.add_row(PhpMixed::List(vec![ Box::new(PhpMixed::String(name)), - Box::new(PhpMixed::String( - package - .get_full_pretty_version( - false, - <dyn PackageInterface>::DISPLAY_SOURCE_REF_IF_DEV, - ) - .to_string(), - )), + Box::new(PhpMixed::String(package.get_full_pretty_version( + false, + crate::package::DisplayMode::SourceRefIfDev, + ))), Box::new(PhpMixed::String(licenses_str)), ])); } @@ -203,7 +198,10 @@ impl LicensesCommand { let mut dep_info: IndexMap<String, PhpMixed> = IndexMap::new(); dep_info.insert( "version".to_string(), - PhpMixed::String(package.get_full_pretty_version(true, 0).to_string()), + PhpMixed::String(package.get_full_pretty_version( + true, + crate::package::DisplayMode::SourceRefIfDev, + )), ); dep_info.insert( "license".to_string(), diff --git a/crates/shirabe/src/command/show_command.rs b/crates/shirabe/src/command/show_command.rs index e7fcfe1..f992798 100644 --- a/crates/shirabe/src/command/show_command.rs +++ b/crates/shirabe/src/command/show_command.rs @@ -606,8 +606,9 @@ impl ShowCommand { && latest_package .as_ref() .unwrap() - .get_full_pretty_version(true, 0) - != package.get_full_pretty_version(true, 0) + .get_full_pretty_version(true, crate::package::DisplayMode::SourceRefIfDev) + != package + .get_full_pretty_version(true, crate::package::DisplayMode::SourceRefIfDev) && (latest_package .as_ref() .unwrap() @@ -905,9 +906,13 @@ impl ShowCommand { // Determine if Composer is checking outdated dependencies and if current package should trigger non-default exit code let mut package_is_up_to_date = if let Some(latest) = latest_package { - latest.get_full_pretty_version(true, 0) - == package.get_full_pretty_version(true, 0) - && latest.as_complete().map_or(true, |c| !c.is_abandoned()) + latest.get_full_pretty_version( + true, + crate::package::DisplayMode::SourceRefIfDev, + ) == package.get_full_pretty_version( + true, + crate::package::DisplayMode::SourceRefIfDev, + ) && latest.as_complete().map_or(true, |c| !c.is_abandoned()) } else { false }; @@ -967,7 +972,10 @@ impl ShowCommand { } name_length = name_length.max(package.get_pretty_name().len()); if write_version { - let mut version_str = package.get_full_pretty_version(true, 0); + let mut version_str = package.get_full_pretty_version( + true, + crate::package::DisplayMode::SourceRefIfDev, + ); if format == "text" { version_str = version_str.trim_start_matches('v').to_string(); } @@ -1003,7 +1011,10 @@ impl ShowCommand { } if write_latest && latest_package.is_some() { let latest = latest_package.unwrap(); - let mut latest_version_str = latest.get_full_pretty_version(true, 0); + let mut latest_version_str = latest.get_full_pretty_version( + true, + crate::package::DisplayMode::SourceRefIfDev, + ); if format == "text" { latest_version_str = latest_version_str.trim_start_matches('v').to_string(); @@ -2518,8 +2529,8 @@ impl ShowCommand { latest_package: PackageInterfaceHandle, package: PackageInterfaceHandle, ) -> String { - if latest_package.get_full_pretty_version(true, 0) - == package.get_full_pretty_version(true, 0) + if latest_package.get_full_pretty_version(true, crate::package::DisplayMode::SourceRefIfDev) + == package.get_full_pretty_version(true, crate::package::DisplayMode::SourceRefIfDev) { return "up-to-date".to_string(); } |
