include branch data
This commit is contained in:
parent
6904a670a8
commit
22f9c9ac78
|
@ -69,6 +69,8 @@ fn main() {
|
|||
});
|
||||
|
||||
let commit = system("git", &["rev-parse", "HEAD"]);
|
||||
|
||||
let branch = system("git", &["rev-parse", "--abbrev-rev", "HEAD"]);
|
||||
|
||||
println!("cargo:rustc-env=COMMIT_HASH={commit}");
|
||||
println!("cargo:rustc-env=COMMIT_BRANCH={branch}");
|
||||
}
|
|
@ -17,12 +17,15 @@ pub struct Redis {
|
|||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct VersionData {
|
||||
pub commit: String
|
||||
pub commit: String,
|
||||
pub branch: String
|
||||
}
|
||||
|
||||
impl Default for VersionData {
|
||||
fn default() -> Self {
|
||||
VersionData {
|
||||
commit: env!("COMMIT_HASH").to_string()
|
||||
commit: env!("COMMIT_HASH").to_string(),
|
||||
branch: env!("COMMIT_BRANCH").to_string()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue