summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolf Vollprecht <w.vollprecht@gmail.com>2023-09-12 12:25:30 +0200
committerGitHub <noreply@github.com>2023-09-12 12:25:30 +0200
commit5ad597ec03407240f275ac1baae0a8f34b1b843d (patch)
treea128cdc6c0c979b3e6432b0e8fd0dc1d208a8716
parent740f4de77a131993133f63d91da4e699e00c9c58 (diff)
fix: remove atty and use stdlib (#337)
-rw-r--r--Cargo.lock37
-rw-r--r--Cargo.toml1
-rw-r--r--src/cli/mod.rs5
3 files changed, 13 insertions, 30 deletions
diff --git a/Cargo.lock b/Cargo.lock
index d711982..918115c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -258,17 +258,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1181e1e0d1fce796a03db1ae795d67167da795f9cf4a39c37589e85ef57f26d3"
[[package]]
-name = "atty"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
-dependencies = [
- "hermit-abi 0.1.19",
- "libc",
- "winapi",
-]
-
-[[package]]
name = "autocfg"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1098,15 +1087,6 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
name = "hermit-abi"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "hermit-abi"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b"
@@ -1341,7 +1321,7 @@ version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
dependencies = [
- "hermit-abi 0.3.2",
+ "hermit-abi",
"libc",
"windows-sys 0.48.0",
]
@@ -1367,7 +1347,7 @@ version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
dependencies = [
- "hermit-abi 0.3.2",
+ "hermit-abi",
"rustix 0.38.13",
"windows-sys 0.48.0",
]
@@ -1422,8 +1402,9 @@ dependencies = [
[[package]]
name = "json-patch"
-version = "1.0.0"
-source = "git+https://github.com/baszalmstra/json-patch?branch=main#f3db28d3c907631c87b7382cebbddc474c8b53ca"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4f7765dccf8c39c3a470fc694efe322969d791e713ca46bc7b5c506886157572"
dependencies = [
"serde",
"serde_json",
@@ -1810,7 +1791,7 @@ version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
dependencies = [
- "hermit-abi 0.3.2",
+ "hermit-abi",
"libc",
]
@@ -1994,7 +1975,6 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
name = "pixi"
version = "0.3.0"
dependencies = [
- "atty",
"chrono",
"clap",
"clap-verbosity-flag",
@@ -3995,3 +3975,8 @@ dependencies = [
"quote",
"syn 1.0.109",
]
+
+[[patch.unused]]
+name = "json-patch"
+version = "1.0.0"
+source = "git+https://github.com/baszalmstra/json-patch?branch=main#f3db28d3c907631c87b7382cebbddc474c8b53ca"
diff --git a/Cargo.toml b/Cargo.toml
index a28d943..62efff2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -16,7 +16,6 @@ rustls-tls = ["reqwest/rustls-tls", "reqwest/rustls-tls-native-roots", "rattler_
slow_integration_tests = []
[dependencies]
-atty = "0.2"
chrono = "0.4.28"
clap = { version = "4.4.2", default-features = false, features = ["derive", "usage", "wrap_help", "std", "color", "error-context"] }
clap-verbosity-flag = "2.0.1"
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
index 8102d89..857f772 100644
--- a/src/cli/mod.rs
+++ b/src/cli/mod.rs
@@ -5,7 +5,7 @@ use clap_complete;
use clap_verbosity_flag::Verbosity;
use miette::IntoDiagnostic;
use rattler_shell::shell::{Shell, ShellEnum};
-use std::io::Write;
+use std::io::{IsTerminal, Write};
use std::str::FromStr;
use tracing_subscriber::{filter::LevelFilter, util::SubscriberInitExt, EnvFilter};
@@ -185,8 +185,7 @@ pub enum ColorOutput {
/// Returns true if the output is considered to be a terminal.
fn is_terminal() -> bool {
- // Crate `atty` provides a platform-independent way of checking whether the output is a tty.
- atty::is(atty::Stream::Stderr)
+ std::io::stderr().is_terminal()
}
/// Returns true if the log outputs should be colored or not.