mirror of
https://github.com/pezkuwichain/revive.git
synced 2026-05-01 02:57:56 +00:00
display the git revision version information (#105)
Signed-off-by: Cyrill Leutwiler <bigcyrill@hotmail.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
fn main() {
|
||||
let git_rev = std::process::Command::new("git")
|
||||
.args(["rev-parse", "--short", "HEAD"])
|
||||
.output()
|
||||
.map(|out| String::from_utf8(out.stdout).unwrap_or_default())
|
||||
.unwrap_or("unknown".to_owned());
|
||||
|
||||
println!("cargo:rustc-env=GIT_COMMIT_HASH={}", git_rev.trim());
|
||||
}
|
||||
@@ -31,10 +31,11 @@ fn main_inner() -> anyhow::Result<()> {
|
||||
|
||||
if arguments.version {
|
||||
println!(
|
||||
"{} v{} (LLVM build {:?})",
|
||||
"{} version {}+commit.{} (LLVM build {:?})",
|
||||
env!("CARGO_PKG_DESCRIPTION"),
|
||||
env!("CARGO_PKG_VERSION"),
|
||||
inkwell::support::get_llvm_version()
|
||||
env!("GIT_COMMIT_HASH"),
|
||||
inkwell::support::get_llvm_version(),
|
||||
);
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user