-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
misc: generate a smarter version string
- Loading branch information
Showing
5 changed files
with
34 additions
and
12 deletions.
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
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
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
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
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,19 @@ | ||
//! Autogenerated build-time information | ||
// (c) 2024 Ross Younger | ||
|
||
/// Build-time info (autogenerated by `built`) | ||
#[allow(unreachable_pub)] | ||
mod build_info { | ||
include!(concat!(env!("OUT_DIR"), "/built.rs")); | ||
} | ||
|
||
/// Short version string | ||
/// | ||
/// If possible use GIT_VERSION; if not, do what we can | ||
pub(crate) fn short() -> String { | ||
if let Some(ver) = build_info::GIT_VERSION { | ||
return ver.into(); | ||
} | ||
let hash = build_info::GIT_COMMIT_HASH_SHORT.unwrap_or("unknown"); | ||
format!("{}-{}", clap::crate_version!(), hash) | ||
} |