diff options
| author | Linus Färnstrand <faern@faern.net> | 2022-09-30 15:30:32 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2022-10-10 09:42:39 +0200 |
| commit | 65450ce01e4435b70fecd90b23ec2eec76c83bf3 (patch) | |
| tree | f2ad0eb1eb6363ac9b0732d6f4901617f50bdb60 /mullvad-setup | |
| parent | 27b3a64254f8b41f1030d0196a0bb0a64b79323b (diff) | |
| download | mullvadvpn-65450ce01e4435b70fecd90b23ec2eec76c83bf3.tar.xz mullvadvpn-65450ce01e4435b70fecd90b23ec2eec76c83bf3.zip | |
Adapt all crates to use mullvad-version
Diffstat (limited to 'mullvad-setup')
| -rw-r--r-- | mullvad-setup/Cargo.toml | 1 | ||||
| -rw-r--r-- | mullvad-setup/build.rs | 7 | ||||
| -rw-r--r-- | mullvad-setup/src/main.rs | 6 |
3 files changed, 3 insertions, 11 deletions
diff --git a/mullvad-setup/Cargo.toml b/mullvad-setup/Cargo.toml index 91d23b80b2..d47ed796ed 100644 --- a/mullvad-setup/Cargo.toml +++ b/mullvad-setup/Cargo.toml @@ -25,6 +25,7 @@ mullvad-daemon = { path = "../mullvad-daemon" } mullvad-paths = { path = "../mullvad-paths" } mullvad-api = { path = "../mullvad-api" } mullvad-types = { path = "../mullvad-types" } +mullvad-version = { path = "../mullvad-version" } talpid-core = { path = "../talpid-core" } talpid-types = { path = "../talpid-types" } diff --git a/mullvad-setup/build.rs b/mullvad-setup/build.rs deleted file mode 100644 index 7cc0a0a5de..0000000000 --- a/mullvad-setup/build.rs +++ /dev/null @@ -1,7 +0,0 @@ -use std::{env, fs, path::PathBuf}; - -fn main() { - let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap()); - let product_version = env!("CARGO_PKG_VERSION").replacen(".0", "", 1); - fs::write(out_dir.join("product-version.txt"), &product_version).unwrap(); -} diff --git a/mullvad-setup/src/main.rs b/mullvad-setup/src/main.rs index 9d353b78a6..2f210ebb76 100644 --- a/mullvad-setup/src/main.rs +++ b/mullvad-setup/src/main.rs @@ -9,10 +9,8 @@ use talpid_core::{ }; use talpid_types::ErrorExt; -pub const PRODUCT_VERSION: &str = include_str!(concat!(env!("OUT_DIR"), "/product-version.txt")); - lazy_static::lazy_static! { - static ref APP_VERSION: ParsedAppVersion = ParsedAppVersion::from_str(PRODUCT_VERSION).unwrap(); + static ref APP_VERSION: ParsedAppVersion = ParsedAppVersion::from_str(mullvad_version::VERSION).unwrap(); static ref IS_DEV_BUILD: bool = APP_VERSION.is_dev(); } @@ -101,7 +99,7 @@ async fn main() { ]; let app = clap::App::new(crate_name!()) - .version(PRODUCT_VERSION) + .version(mullvad_version::VERSION) .author(crate_authors!()) .about(crate_description!()) .setting(clap::AppSettings::SubcommandRequiredElseHelp) |
