Repository: pier-cli/pier (language: rust)

Issue:
Show output to stderr as it happens.
I'm using a shell script managed by pier to perform various update tasks. One of these tasks is running `rustup update`. Currently, when I run this script, some of the progress output goes to stderr and is only visible after the whole script finishes. I think it would be better to show stderr output as it is produced by the script subprocess.

I think the issue might stem from [this line](https://github.com/pier-cli/pier/blob/master/src/script.rs#L49).




Discussion / hints:
Hey, thanks for the issue. 

Sorry about  not replying very quickly, decided to do a tech detox while on a vacation so I'm just getting back to these now.

The issue is as you mentioned that line so it'll be a quick fix, you can send a pull request if you want to fix it. Or I can make one and give you credit! 

Maybe a cool idea would be to set the colour on the output text to green / red or orange depending if the line is stdout or stderr, would you find that useful in your usage do you think? :)
I'll open a pull request with the change. 

As for coloured output: In my use case, the commands already colour their output to stdout. I believe with the proposed change, the same would be true for stderr. However, there may be use cases where such an output colouring makes sense. Perhaps that feature should be broken out into a separate issue?

Fix patch:
diff --git a/src/script.rs b/src/script.rs
index fda070e..14f290e 100644
--- a/src/script.rs
+++ b/src/script.rs
@@ -5,7 +5,7 @@ use snafu::ResultExt;
 use std::fs::File;
 use std::io::prelude::*;
 use std::os::unix::fs::PermissionsExt;
-use std::process::{Command, Output, Stdio};
+use std::process::{Command, Output};
 use tempfile;
 
 #[derive(Serialize, Deserialize, Debug, Clone)]
@@ -38,15 +38,18 @@ impl Script {
         }
     }
     /// Runs the script inline using something like sh -c "<script>" or python -c "<script."...
-    pub fn run_with_cli_interpreter(&self, interpreter: &Vec<String>, args: Vec<String>) -> Result<Output> {
+    pub fn run_with_cli_interpreter(
+        &self,
+        interpreter: &Vec<String>,
+        args: Vec<String>,
+    ) -> Result<Output> {
         // First item in interpreter is the binary
         let cmd = Command::new(&interpreter[0])
             // The following items after the binary is any commandline args that are necessary.
             .args(&interpreter[1..])
             .arg(&self.command)
-	    .arg(&self.alias)
-	    .args(&args)
-            .stderr(Stdio::piped())
+            .arg(&self.alias)
+            .args(&args)
             .spawn()
             .context(CommandExec)?
             .wait_with_output()
@@ -88,8 +91,7 @@ impl Script {
         }
 
         let cmd = Command::new(exec_file_path)
-            .stderr(Stdio::piped())
-	    .args(&args)
+            .args(&args)
             .spawn()
             .context(CommandExec)?
             .wait_with_output()


Test patch: