diff --git a/Cargo.lock b/Cargo.lock index 78079be..03b6cec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -943,6 +943,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "is_ci" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -1120,6 +1126,15 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "owo-colors" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" +dependencies = [ + "supports-color", +] + [[package]] name = "parking_lot" version = "0.12.3" @@ -1707,9 +1722,9 @@ dependencies = [ name = "soldeer" version = "0.4.0" dependencies = [ + "owo-colors", "soldeer-commands", "tokio", - "yansi", ] [[package]] @@ -1771,6 +1786,16 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "supports-color" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +dependencies = [ + "is-terminal", + "is_ci", +] + [[package]] name = "syn" version = "2.0.77" @@ -2460,15 +2485,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "yansi" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" -dependencies = [ - "is-terminal", -] - [[package]] name = "zerocopy" version = "0.7.35" diff --git a/crates/soldeer/Cargo.toml b/crates/soldeer/Cargo.toml index 883f760..b8dc29b 100644 --- a/crates/soldeer/Cargo.toml +++ b/crates/soldeer/Cargo.toml @@ -21,6 +21,6 @@ name = "soldeer" path = "src/main.rs" [dependencies] +owo-colors = { version = "4.0.0", features = ["supports-colors"] } soldeer-commands = { path = "../soldeer-commands" } tokio.workspace = true -yansi = { version = "1.0.1", features = ["detect-tty", "detect-env"] } diff --git a/crates/soldeer/src/main.rs b/crates/soldeer/src/main.rs index eb05b5e..09cfced 100644 --- a/crates/soldeer/src/main.rs +++ b/crates/soldeer/src/main.rs @@ -1,11 +1,11 @@ //! Soldeer is a package manager for Solidity projects +use owo_colors::{OwoColorize, Stream::Stderr}; use soldeer_commands::{commands::Parser as _, run, Args}; -use yansi::Paint as _; #[tokio::main] async fn main() { let args = Args::parse(); if let Err(err) = run(args.command).await { - eprintln!("{}", err.to_string().red()) + eprintln!("{}", err.to_string().if_supports_color(Stderr, |t| t.red())) } }