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