-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: include more details in version info (#112)
- Loading branch information
Showing
7 changed files
with
99 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,27 @@ | ||
//! Information about this shell project. | ||
/// The formal name of this product. | ||
pub const PRODUCT_NAME: &str = "brush"; | ||
|
||
const PRODUCT_HOMEPAGE: &str = env!("CARGO_PKG_HOMEPAGE"); | ||
const PRODUCT_REPO: &str = env!("CARGO_PKG_REPOSITORY"); | ||
|
||
/// The URI to display as the product's homepage. | ||
#[allow(clippy::const_is_empty)] | ||
pub const PRODUCT_DISPLAY_URI: &str = if !PRODUCT_HOMEPAGE.is_empty() { | ||
PRODUCT_HOMEPAGE | ||
} else { | ||
PRODUCT_REPO | ||
}; | ||
|
||
/// The version of the product, in string form. | ||
pub const PRODUCT_VERSION: &str = env!("CARGO_PKG_VERSION"); | ||
|
||
/// Info regarding the specific version of sources used to build this product. | ||
pub const PRODUCT_GIT_VERSION: &str = git_version::git_version!(); | ||
|
||
pub(crate) fn get_product_display_str() -> String { | ||
std::format!( | ||
"{PRODUCT_NAME} version {PRODUCT_VERSION} ({PRODUCT_GIT_VERSION}) - {PRODUCT_DISPLAY_URI}" | ||
) | ||
} |
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