Merge remote-tracking branch 'origin/include_git_hash' into add_messages
This commit is contained in:
commit
b6d61e4bd1
7
build.rs
Normal file
7
build.rs
Normal file
@ -0,0 +1,7 @@
|
||||
use std::process::Command;
|
||||
|
||||
fn main() {
|
||||
let output = Command::new("git").args(&["rev-parse", "--short", "HEAD"]).output().unwrap();
|
||||
let git_hash = String::from_utf8(output.stdout).unwrap();
|
||||
println!("cargo:rustc-env=GIT_HASH={}", git_hash);
|
||||
}
|
@ -187,6 +187,7 @@ fn main() -> Result<()> {
|
||||
text += format!("\nYou gained {} experience.", game.get_player().get_experience()).as_str();
|
||||
text += format!("\nYou collected {} gold.", game.get_player().get_gold()).as_str();
|
||||
text += format!("\nYou played {} seconds.", playtime.as_secs()).as_str();
|
||||
text += format!("\nYou played game version '{}'.", env!("GIT_HASH")).as_str();
|
||||
let paragraph = Paragraph::new(text).block(block).wrap(Wrap { trim: true });
|
||||
frame.render_widget(paragraph, area);
|
||||
});
|
||||
@ -198,7 +199,6 @@ fn main() -> Result<()> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stdout().execute(LeaveAlternateScreen)?;
|
||||
disable_raw_mode()?;
|
||||
Ok(())
|
||||
|
Loading…
Reference in New Issue
Block a user