Skip to content

Commit

Permalink
fix: unexpected error while piping to shell execution on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden committed Oct 17, 2024
1 parent 81db815 commit f303aae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ async fn run(config: GlobalConfig, cli: Cli, text: Option<String>) -> Result<()>
}
let is_repl = config.read().working_mode.is_repl();
if cli.execute && !is_repl {
if cfg!(target_os = "macos") && !stdin().is_terminal() {
bail!("Unable to read the pipe for shell execution on MacOS")
}
let input = create_input(&config, text, &cli.file).await?;
shell_execute(&config, &SHELL, input).await?;
return Ok(());
Expand Down

0 comments on commit f303aae

Please sign in to comment.