diff options
author | Laurențiu Nicola <[email protected]> | 2021-03-12 17:49:00 +0000 |
---|---|---|
committer | Laurențiu Nicola <[email protected]> | 2021-03-12 17:49:00 +0000 |
commit | 88ef0541a5110563f3f2e92532da37209d264ad9 (patch) | |
tree | 4e7a8cdab4df02b11434049e0f70daf952a54098 /crates | |
parent | c0459c53572f90fa9134192e432562af3daba5fa (diff) |
Improve version display
Diffstat (limited to 'crates')
-rw-r--r-- | crates/rust-analyzer/build.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/crates/rust-analyzer/build.rs b/crates/rust-analyzer/build.rs index 5ae76ba30..999dc5928 100644 --- a/crates/rust-analyzer/build.rs +++ b/crates/rust-analyzer/build.rs | |||
@@ -39,8 +39,7 @@ fn set_rerun() { | |||
39 | } | 39 | } |
40 | 40 | ||
41 | fn rev() -> Option<String> { | 41 | fn rev() -> Option<String> { |
42 | let output = Command::new("git").args(&["rev-parse", "HEAD"]).output().ok()?; | 42 | let output = Command::new("git").args(&["describe", "--tags"]).output().ok()?; |
43 | let stdout = String::from_utf8(output.stdout).ok()?; | 43 | let stdout = String::from_utf8(output.stdout).ok()?; |
44 | let short_hash = stdout.get(0..7)?; | 44 | Some(stdout) |
45 | Some(short_hash.to_owned()) | ||
46 | } | 45 | } |