diff --git a/src/functions.rs b/src/functions.rs index fb09451..852b933 100644 --- a/src/functions.rs +++ b/src/functions.rs @@ -252,30 +252,6 @@ pub fn init_log(data_local_path: &Path) -> Result<(), FxError> { Ok(()) } -/// Check the latest version of felix. -pub fn check_version() -> Result<(), FxError> { - let output = std::process::Command::new("cargo") - .args(["search", "felix", "--limit", "1"]) - .output()? - .stdout; - if !output.is_empty() { - if let Ok(ver) = std::str::from_utf8(&output) { - let latest: String = ver.chars().skip(9).take_while(|x| *x != '\"').collect(); - let current = env!("CARGO_PKG_VERSION"); - if latest != current { - println!("felix v{}: Latest version is {}.", current, latest); - } else { - println!("felix v{}: Up to date.", current); - } - } else { - println!("Cannot read the version."); - } - } else { - println!("Cannot fetch the latest version: Check your internet connection."); - } - Ok(()) -} - /// linux-specific: Convert u32 to permission-ish string. pub fn convert_to_permissions(permissions: u32) -> String { let permissions = format!("{permissions:o}"); diff --git a/src/main.rs b/src/main.rs index 58b122f..d87652a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,7 +32,7 @@ fn main() -> Result<(), errors::FxError> { print!("{}", help::HELP); } "-v" | "--version" => { - functions::check_version()?; + println!("felix v{}", env!("CARGO_PKG_VERSION")); } "-l" | "--log" => { if let Err(e) = run::run(