Skip to content

Commit

Permalink
remove the dependency atty (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
demoray authored Feb 6, 2025
1 parent b10bef0 commit 3724e9d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 47 deletions.
45 changes: 1 addition & 44 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ rust-version = "1.70.0"
default = ["put", "blobstore", "native-tls"]
put = ["dep:reqwest", "reqwest?/stream", "dep:url", "dep:tokio", "dep:tokio-util"]
blobstore = ["dep:url", "dep:azure_core", "dep:azure_storage_blobs", "dep:tokio", "dep:tokio-util", "dep:async-channel"]
status = ["dep:atty", "dep:indicatif"]
status = ["dep:indicatif"]
native-tls = ["dep:native-tls"]

[dependencies]
Expand All @@ -31,7 +31,6 @@ thiserror = "2.0"
libc = "0.2"

async-channel = {version="2.3", optional=true}
atty = {version="0.2", optional=true}
azure_core = {version="0.21", optional=true}
azure_storage_blobs = {version="0.21", optional=true}
indicatif = {version="0.17", optional=true}
Expand Down
4 changes: 3 additions & 1 deletion src/upload/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#[cfg(all(feature = "status", any(feature = "blobstore", feature = "put")))]
use indicatif::{ProgressBar, ProgressFinish, ProgressStyle};
#[cfg(all(feature = "status", any(feature = "blobstore", feature = "put")))]
use std::io::{stdin, IsTerminal};

#[cfg(all(feature = "status", any(feature = "blobstore", feature = "put")))]
#[derive(Clone)]
Expand All @@ -15,7 +17,7 @@ pub struct Status {
impl Status {
pub fn new(total: Option<u64>) -> Self {
let size = total.unwrap_or(0);
let bar = if atty::is(atty::Stream::Stdin) {
let bar = if stdin().is_terminal() {
Some(
ProgressBar::new(size)
.with_style(
Expand Down

0 comments on commit 3724e9d

Please sign in to comment.