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
This commit is contained in:
Casey Rodarmor 2016-11-10 23:09:02 -08:00 committed by GitHub
parent 5b3ef9f11a
commit c775828d3c
2 changed files with 2 additions and 3 deletions

View File

@ -21,14 +21,13 @@ version = `sed -En 's/version = "([^"]+)"/\1/p' Cargo.toml`
publish: clippy build publish: clippy build
git branch | grep '* master' git branch | grep '* master'
git diff --no-ext-diff --quiet --exit-code git diff --no-ext-diff --quiet --exit-code
grep 'version("{{version}}")' src/app.rs
git co -b v{{version}} git co -b v{{version}}
git push github git push github
cargo publish cargo publish
git tag -a "v{{version}}" -m "v{{version}}" git tag -a "v{{version}}" -m "v{{version}}"
git push github --tags git push github --tags
git push origin --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: clippy:
rustup run nightly cargo clippy rustup run nightly cargo clippy

View File

@ -23,7 +23,7 @@ macro_rules! die {
pub fn app() { pub fn app() {
let matches = App::new("just") let matches = App::new("just")
.version("0.2.16") .version(concat!("v", env!("CARGO_PKG_VERSION")))
.author("Casey Rodarmor <casey@rodarmor.com>") .author("Casey Rodarmor <casey@rodarmor.com>")
.about("Just a command runner - https://github.com/casey/just") .about("Just a command runner - https://github.com/casey/just")
.setting(AppSettings::ColoredHelp) .setting(AppSettings::ColoredHelp)