diff --git a/src/main.rs b/src/main.rs index da8f92e..e9b713f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,8 @@ use std::{ env::current_dir, + io::{ stdout, IsTerminal }, path::Path, - process::{ Command, Stdio } + process::{ exit, Command, Stdio } }; use pico_args::Arguments; @@ -110,6 +111,11 @@ fn main() { let command = properties.get("command").unwrap().as_str().unwrap().to_string(); let shell = properties.get("shell").unwrap_or(&Value::Boolean(false)).as_bool().unwrap(); + if !stdout().is_terminal() { + println!("{command} {i_target}"); + exit(0); + } + // build child let mut parts = command.split(" "); let mut child = Command::new(parts.next().unwrap());