fix `NO_COLOR` support

pull/36/head
chris west 1 year ago
parent 0c970dcb3a
commit 3f2ae945db

@ -1,3 +1,7 @@
## v1.2.1-dev
- Fix `NO_COLOR` support.
## v1.2.0
phetch is all about fun colors, but your options have always been

@ -116,6 +116,10 @@ item.unsupported {item_unsupported}",
/// Convert a string like "blue underline" or "red" into a color code.
pub fn to_color<S: AsRef<str>>(line: S) -> String {
if *crate::NO_COLOR {
return "".into();
}
let parts = line.as_ref().split(' ').collect::<Vec<_>>();
if parts.is_empty() {

Loading…
Cancel
Save