Skip to content

Commit 2b6903a

Browse files
committed
Remove 'atty' dependency and replace its usage with 'std::io::stdout().is_terminal()' for terminal detection
1 parent 9f0545b commit 2b6903a

File tree

3 files changed

+5
-26
lines changed

3 files changed

+5
-26
lines changed

Cargo.lock

Lines changed: 3 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ url = "2.4.0"
3535
zip = { version = "0.6.4", default-features = false }
3636
base64 = "0.21.5"
3737
serde_json = "1.0.107"
38-
atty = "0.2.14"
3938
qr2term = { version = "0.3.1", optional = true }
4039
self_update = { version = "0.37.0", default-features = false, features = ["archive-zip", "archive-tar", "compression-flate2", "compression-zip-deflate"] }
4140

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::env;
22
use std::path::PathBuf;
3+
use std::io::IsTerminal;
34

45
use anyhow::bail;
56
use clap::{Parser, Subcommand};
@@ -220,7 +221,7 @@ async fn main() -> anyhow::Result<()> {
220221
};
221222
let refresh_token = if opt.refresh_token.is_none()
222223
&& refresh_token_from_file.is_none()
223-
&& atty::is(atty::Stream::Stdout)
224+
&& std::io::stdout().is_terminal()
224225
{
225226
login(drive_config.clone(), 30).await?
226227
} else {

0 commit comments

Comments
 (0)