forked from agama-project/agama
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show the git HEAD sha in version output
The argument `migrate-wicked --version` show something like migrate-wicked 0.1.0~7c9199b0f
- Loading branch information
1 parent
6b4a27d
commit 892e61f
Showing
2 changed files
with
12 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use std::process::Command; | ||
|
||
fn main() { | ||
let output = Command::new("git") | ||
.args(&["rev-parse", "HEAD"]) | ||
.output() | ||
.unwrap(); | ||
let mut git_hash = String::from_utf8(output.stdout).unwrap(); | ||
git_hash.truncate(9); | ||
println!("cargo:rustc-env=GIT_HEAD={}", git_hash); | ||
} |
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