summaryrefslogtreecommitdiff
path: root/cli/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/build.rs')
-rw-r--r--cli/build.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/cli/build.rs b/cli/build.rs
index 47809487..014960f4 100644
--- a/cli/build.rs
+++ b/cli/build.rs
@@ -6,12 +6,14 @@ fn main() {
return;
}
- let version = Command::new("git")
+ let pkg = env!("CARGO_PKG_VERSION");
+ let hash = Command::new("git")
.args(["rev-parse", "HEAD"])
.output()
.ok()
.filter(|output| output.status.success())
.and_then(|output| String::from_utf8(output.stdout.get(..8)?.into()).ok())
- .unwrap_or_else(|| "(unknown version)".into());
- println!("cargo:rustc-env=TYPST_VERSION={version}");
+ .unwrap_or_else(|| "(unknown hash)".into());
+
+ println!("cargo:rustc-env=TYPST_VERSION={pkg} ({hash})");
}