Use version string from git, if present

This commit is contained in:
Matthias Beyer 2018-02-13 11:53:51 +01:00
parent c43abf09d1
commit 3bd8822f4f

View file

@ -21,12 +21,12 @@
macro_rules! make_imag_version { macro_rules! make_imag_version {
() => {{ () => {{
let pkg_version = env!("CARGO_PKG_VERSION"); let pkg_version = env!("CARGO_PKG_VERSION");
let git_version = env!("CARGO_BUILD_GIT_HASH"); let git_version = env!("CARGO_BUILD_VERSION");
if git_version == "" { if git_version == "" {
String::from(pkg_version) String::from(pkg_version)
} else { } else {
format!("{}-{}", pkg_version, git_version) String::from(git_version)
} }
}} }}
} }