Skip to content

Commit

Permalink
fix: forbid reading data from stdin on macos (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
fioncat committed May 22, 2024
1 parent 63d01e9 commit 45718ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ fn run() -> Result<()> {
fs::read(path).context("read file")?
}
None => {
if cfg!(target_os = "macos") {
// Read from stdin is not supported on macos.
// See: <https://github.com/crossterm-rs/crossterm/issues/500>
bail!(
"reading data from stdin is not supported on macos, please read it from file"
);
}
let mut data = Vec::new();
io::stdin().read_to_end(&mut data).context("read stdin")?;
data
Expand Down

0 comments on commit 45718ae

Please sign in to comment.