2020-02-20 14:11:53 -05:00
|
|
|
macro_rules! warn {
|
|
|
|
($fmt:literal, $ex:expr) => {{
|
2021-03-19 05:16:07 -04:00
|
|
|
use std::env;
|
2020-02-20 14:11:53 -05:00
|
|
|
use console::{style, Emoji};
|
|
|
|
let formatstr = format!($fmt, $ex);
|
2021-03-20 14:52:57 -04:00
|
|
|
if env::var("NO_EMOJI").is_ok() {
|
|
|
|
println!(
|
|
|
|
"{} {}",
|
|
|
|
style("!").red(),
|
|
|
|
style(formatstr).red()
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
println!(
|
|
|
|
"{} {}",
|
|
|
|
style(Emoji("⚠️ ", "!")).red(),
|
|
|
|
style(formatstr).red()
|
|
|
|
);
|
2021-03-19 05:16:07 -04:00
|
|
|
}
|
2020-02-20 14:11:53 -05:00
|
|
|
}};
|
|
|
|
}
|
|
|
|
|
|
|
|
macro_rules! success {
|
|
|
|
($fmt:literal, $ex:expr) => {{
|
2021-03-19 05:16:07 -04:00
|
|
|
use std::env;
|
2020-02-20 14:11:53 -05:00
|
|
|
use console::{style, Emoji};
|
|
|
|
let formatstr = format!($fmt, $ex);
|
2021-03-20 14:52:57 -04:00
|
|
|
if env::var("NO_EMOJI").is_ok() {
|
|
|
|
println!(
|
|
|
|
"{} {}",
|
|
|
|
style("✓").green(),
|
|
|
|
style(formatstr).green()
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
println!(
|
|
|
|
"{} {}",
|
|
|
|
style(Emoji("✅", "✓")).green(),
|
|
|
|
style(formatstr).green()
|
|
|
|
);
|
2021-03-19 05:16:07 -04:00
|
|
|
}
|
2020-02-20 14:11:53 -05:00
|
|
|
}};
|
|
|
|
}
|