feat: with direct output
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
dc0fa589a5
commit
f8035357b7
@ -29,10 +29,8 @@ impl ShellAction {
|
||||
let current_dir = current_dir()?;
|
||||
log::trace!("current executable dir={}", current_dir.to_string_lossy());
|
||||
|
||||
let mut process = Command::new(path.clone())
|
||||
let mut process = Command::new(&path)
|
||||
.current_dir(current_dir)
|
||||
.stdout(Stdio::piped())
|
||||
.stderr(Stdio::piped())
|
||||
.envs(variables.iter().map(|v| {
|
||||
log::trace!("{:?}", v);
|
||||
|
||||
@ -40,20 +38,6 @@ impl ShellAction {
|
||||
}))
|
||||
.spawn()?;
|
||||
|
||||
if let Some(ref mut stdout) = process.stdout {
|
||||
for line in BufReader::new(stdout).lines() {
|
||||
let line = line.unwrap();
|
||||
println!("[{}] {}", self.name, line);
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(ref mut stderr) = process.stderr {
|
||||
for line in BufReader::new(stderr).lines() {
|
||||
let line = line.unwrap();
|
||||
println!("[{}] {}", self.name, line);
|
||||
}
|
||||
}
|
||||
|
||||
let status = process.wait()?;
|
||||
|
||||
match status.code() {
|
||||
|
Loading…
Reference in New Issue
Block a user