Skip to content

Commit

Permalink
Replace atty with std::io::IsTerminal (#973)
Browse files Browse the repository at this point in the history
Co-authored-by: Gal Schlezinger <gal@spitfire.co.il>
  • Loading branch information
tottoto and Schniz committed Jul 1, 2023
1 parent 6147d42 commit ef2bf6e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ tempfile = "3.6.0"
indoc = "2.0.1"
log = "0.4.19"
env_logger = "0.10.0"
atty = "0.2.14"
encoding_rs_io = "0.1.7"
reqwest = { version = "0.11.18", features = ["blocking", "json", "rustls-tls", "rustls-tls-native-roots", "brotli"], default-features = false }
url = "2.4.0"
Expand Down
4 changes: 2 additions & 2 deletions src/commands/use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,9 @@ fn replace_symlink(from: &std::path::Path, to: &std::path::Path) -> std::io::Res
}

fn should_install_interactively(requested_version: &UserVersion) -> bool {
use std::io::Write;
use std::io::{IsTerminal, Write};

if !(atty::is(atty::Stream::Stdout) && atty::is(atty::Stream::Stdin)) {
if !(std::io::stdout().is_terminal() && std::io::stdin().is_terminal()) {
return false;
}

Expand Down

0 comments on commit ef2bf6e

Please sign in to comment.