Created
August 10, 2017 12:25
-
-
Save piotrrojek/2fb0206569e2b5d957a9d8caa91cf9ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::process::Command; | |
const VERSION: Option<&'static str> = option_env!("CARGO_PKG_VERSION"); | |
fn main() { | |
println!("Hello, world!"); | |
println!("version: {}", VERSION.unwrap_or("dev")); | |
let output = Command::new("git") | |
.args(&["rev-parse", "HEAD"]) | |
.output().unwrap(); | |
let git_hash = String::from_utf8(output.stdout).unwrap(); | |
println!("Git hash: {}", git_hash) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment