From ee794d2e40bedf504a6351912522083d42a54122 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Sat, 7 Jan 2023 12:31:12 +0800 Subject: [PATCH] no gen_version if debug --- libs/hbb_common/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/hbb_common/src/lib.rs b/libs/hbb_common/src/lib.rs index 8bdbb87..6270850 100644 --- a/libs/hbb_common/src/lib.rs +++ b/libs/hbb_common/src/lib.rs @@ -180,6 +180,10 @@ pub fn get_version_from_url(url: &str) -> String { } pub fn gen_version() { + if Ok("release".to_owned()) != std::env::var("PROFILE") { + return; + } + println!("cargo:rerun-if-changed=Cargo.toml"); use std::io::prelude::*; let mut file = File::create("./src/version.rs").unwrap(); for line in read_lines("Cargo.toml").unwrap().flatten() {