From c775828d3cb5efb537d6f288468d440932c6abba Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Thu, 10 Nov 2016 23:09:02 -0800 Subject: [PATCH] Use version from env! macro (#37) This saves us from having to manually keep the version string in app.rs up to date, so we can also drop that check from the publish recipe. Fixes #36 --- justfile | 3 +-- src/app.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index a46872d..49874fe 100644 --- a/justfile +++ b/justfile @@ -21,14 +21,13 @@ version = `sed -En 's/version = "([^"]+)"/\1/p' Cargo.toml` publish: clippy build git branch | grep '* master' git diff --no-ext-diff --quiet --exit-code - grep 'version("{{version}}")' src/app.rs git co -b v{{version}} git push github cargo publish git tag -a "v{{version}}" -m "v{{version}}" git push github --tags git push origin --tags - @echo 'Remember to merge v{{version}} branch on GitHub!' + @echo 'Remember to merge the v{{version}} branch on GitHub!' clippy: rustup run nightly cargo clippy diff --git a/src/app.rs b/src/app.rs index cb2a529..31b56bd 100644 --- a/src/app.rs +++ b/src/app.rs @@ -23,7 +23,7 @@ macro_rules! die { pub fn app() { let matches = App::new("just") - .version("0.2.16") + .version(concat!("v", env!("CARGO_PKG_VERSION"))) .author("Casey Rodarmor ") .about("Just a command runner - https://github.com/casey/just") .setting(AppSettings::ColoredHelp)