Browse Source

Replace atty with std::io::IsTerminal (#973)

Co-authored-by: Gal Schlezinger <gal@spitfire.co.il>
remotes/origin/list-filter
tottoto 2 years ago committed by GitHub
parent
commit
ef2bf6e512
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      Cargo.lock
  2. 1
      Cargo.toml
  3. 4
      src/commands/use.rs

1
Cargo.lock generated

@ -592,7 +592,6 @@ name = "fnm" @@ -592,7 +592,6 @@ name = "fnm"
version = "1.33.1"
dependencies = [
"anyhow",
"atty",
"chrono",
"clap",
"clap_complete",

1
Cargo.toml

@ -23,7 +23,6 @@ tempfile = "3.6.0" @@ -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"

4
src/commands/use.rs

@ -159,9 +159,9 @@ fn replace_symlink(from: &std::path::Path, to: &std::path::Path) -> std::io::Res @@ -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;
}

Loading…
Cancel
Save