Skip to content

Commit

Permalink
Merge pull request #405 from str4d/359-replace-atty
Browse files Browse the repository at this point in the history
age: Replace `atty` with `is-terminal`
  • Loading branch information
str4d committed Aug 6, 2023
2 parents 3b29ef6 + 4d81bb0 commit ea42d81
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 40 deletions.
26 changes: 3 additions & 23 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions age/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ web-sys = { version = "0.3", optional = true, features = ["Window", "Performance
memchr = { version = "2.5", optional = true }

# Common CLI dependencies
atty = { version = "0.2", optional = true }
console = { version = "0.15", optional = true, default-features = false }
is-terminal = { version = "0.4", optional = true }
rpassword = { version = "7", optional = true }

[target.'cfg(any(unix, windows))'.dependencies]
Expand Down Expand Up @@ -102,7 +102,7 @@ criterion-cycles-per-byte = "0.5"
default = []
armor = []
async = ["futures", "memchr"]
cli-common = ["atty", "console", "pinentry", "rpassword"]
cli-common = ["console", "is-terminal", "pinentry", "rpassword"]
plugin = ["age-core/plugin", "which", "wsl"]
ssh = [
"aes",
Expand Down
3 changes: 2 additions & 1 deletion age/src/cli_common/file_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::io::{self, Read, Write};
#[cfg(unix)]
use std::os::unix::fs::OpenOptionsExt;

use is_terminal::IsTerminal;
use zeroize::Zeroize;

use crate::{fl, util::LINE_ENDING, wfl, wlnfl};
Expand Down Expand Up @@ -61,7 +62,7 @@ impl InputReader {

/// Returns true if this input is from a terminal, and a user is likely typing it.
pub fn is_terminal(&self) -> bool {
matches!(self, Self::Stdin(_)) && atty::is(atty::Stream::Stdin)
matches!(self, Self::Stdin(_)) && io::stdin().is_terminal()
}
}

Expand Down
4 changes: 0 additions & 4 deletions supply-chain/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,6 @@ criteria = "safe-to-deploy"
version = "0.8.1"
criteria = "safe-to-deploy"

[[exemptions.hermit-abi]]
version = "0.1.19"
criteria = "safe-to-deploy"

[[exemptions.hermit-abi]]
version = "0.3.2"
criteria = "safe-to-deploy"
Expand Down
10 changes: 0 additions & 10 deletions supply-chain/imports.lock
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,6 @@ criteria = "safe-to-deploy"
version = "0.1.6"
notes = "Contains no unsafe code, no IO, no build.rs."

[[audits.bytecode-alliance.audits.atty]]
who = "Alex Crichton <alex@alexcrichton.com>"
criteria = "safe-to-deploy"
version = "0.2.14"
notes = """
Contains only unsafe code for what this crate's purpose is and only accesses
the environment's terminal information when asked. Does its stated purpose and
no more.
"""

[[audits.bytecode-alliance.audits.base64]]
who = "Pat Hickey <phickey@fastly.com>"
criteria = "safe-to-deploy"
Expand Down

0 comments on commit ea42d81

Please sign in to comment.