From f50b86ed1ed43ecfe76ee0e3cd4f4968b89fe3e0 Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Thu, 30 Apr 2020 17:57:01 -0700 Subject: [PATCH] Correctly gen version --- Cargo.lock | 2 +- cli/Cargo.toml | 2 +- cli/src/lib.rs | 4 +++- cli/src/main.rs | 3 ++- cli/src/version.rs | 1 + mkrelease.sh | 3 +++ 6 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 cli/src/version.rs diff --git a/Cargo.lock b/Cargo.lock index 5d52d19..15800ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2530,7 +2530,7 @@ dependencies = [ [[package]] name = "zecwallet-cli" -version = "1.1.0" +version = "1.3.2" dependencies = [ "byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 9b0b2eb..eb4effb 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zecwallet-cli" -version = "1.1.0" +version = "1.3.2" edition = "2018" [dependencies] diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 64b8b69..6124fdd 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -8,10 +8,12 @@ use zecwalletlitelib::{commands, lightclient::{LightClient, LightClientConfig}, }; +pub mod version; + #[macro_export] macro_rules! configure_clapapp { ( $freshapp: expr ) => { - $freshapp.version("1.0.0") + $freshapp.version(VERSION) .arg(Arg::with_name("dangerous") .long("dangerous") .help("Disable server TLS certificate verification. Use this if you're running a local lightwalletd with a self-signed certificate. WARNING: This is dangerous, don't use it with a server that is not your own.") diff --git a/cli/src/main.rs b/cli/src/main.rs index 96247f4..0a07850 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -3,7 +3,8 @@ use zecwallet_cli::{configure_clapapp, report_permission_error, startup, start_interactive, - attempt_recover_seed}; + attempt_recover_seed, + version::VERSION}; use log::error; pub fn main() { diff --git a/cli/src/version.rs b/cli/src/version.rs new file mode 100644 index 0000000..0a5258c --- /dev/null +++ b/cli/src/version.rs @@ -0,0 +1 @@ +pub const VERSION:&str = "1.3.2"; diff --git a/mkrelease.sh b/mkrelease.sh index 3b17bba..7670bc7 100755 --- a/mkrelease.sh +++ b/mkrelease.sh @@ -25,6 +25,9 @@ set -- "${POSITIONAL[@]}" # restore positional parameters if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi +# Write the version file +echo "pub const VERSION:&str = \"$APP_VERSION\";" > cli/src/version.rs + # First, do the tests cd lib && cargo test --release retVal=$?