Display current branch and version on the footer #10
|
@ -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