Inject soft hyphen into commit hash so it works better on more screens
This commit is contained in:
parent
ca805f1a9d
commit
2bf201e3fd
1 changed files with 13 additions and 1 deletions
|
@ -5,6 +5,8 @@
|
||||||
|
|
||||||
pub const PROJECT_NAME: &str = env!("CARGO_PKG_NAME");
|
pub const PROJECT_NAME: &str = env!("CARGO_PKG_NAME");
|
||||||
|
|
||||||
|
const SOFT_HYPHEN: &str = "\u{00AD}";
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref VERSION: String = || -> String {
|
pub static ref VERSION: String = || -> String {
|
||||||
let mut components = Vec::<String>::new();
|
let mut components = Vec::<String>::new();
|
||||||
|
@ -24,7 +26,17 @@ lazy_static! {
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(commit) = option_env!("TRAVIS_COMMIT") {
|
if let Some(commit) = option_env!("TRAVIS_COMMIT") {
|
||||||
components.push(format!("commit:{}", commit));
|
components.push(format!("commit:{}",
|
||||||
|
commit
|
||||||
|
.as_bytes()
|
||||||
|
.chunks(4)
|
||||||
|
.map(|x|
|
||||||
|
String::from_utf8(x.to_owned())
|
||||||
|
.unwrap_or_else(|_| String::new())
|
||||||
|
)
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join(SOFT_HYPHEN)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
if components.len() > 0 {
|
if components.len() > 0 {
|
||||||
|
|
Loading…
Reference in a new issue