MCPcopy Create free account
hub / github.com/Wulf/create-rust-app / check_cli_version

Function check_cli_version

crates/create-rust-app_cli/src/content/project.rs:719–734  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

717}
718
719pub fn check_cli_version() {
720 let name = env!("CARGO_PKG_NAME");
721 let version = env!("CARGO_PKG_VERSION");
722 let informer = update_informer::new(registry::Crates, name, version)
723 .timeout(Duration::from_secs(2))
724 .interval(Duration::ZERO);
725 informer.check_version().ok().flatten().map_or_else(|| {
726 logger::message(&format!("v{version}"));
727 }, |new_version| {
728 logger::message(&style(&format!("You are running `{name}` v{version}, which is behind the latest release ({new_version}).")).yellow().to_string());
729 logger::message(&format!(
730 "If you want to update, try: {}",
731 style("cargo install --force create-rust-app_cli").yellow()
732 ));
733 });
734}

Callers 1

mainFunction · 0.85

Calls 2

messageFunction · 0.85
to_stringMethod · 0.80

Tested by

no test coverage detected