From 7ea15ce502af5c963af22f8853a1e1635f3aabe6 Mon Sep 17 00:00:00 2001 From: teldra Date: Thu, 19 Dec 2019 19:17:28 +0100 Subject: [PATCH] fix defunc spawned --- src/main.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index de389ea..a53cd1d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -247,12 +247,11 @@ fn main() { unseen[i] = num_unseen; let output_path = ::std::env::args().nth(1).unwrap(); let commands = ::std::env::args().nth(2).unwrap(); + let the_output = Command::new("sh").arg("-c").arg(&commands).output() + .ok().expect("Failed to execute."); let mut file = std::fs::File::create(&output_path).expect("create failed"); file.write_all(num_unseen.to_string().as_bytes()).expect( "write failed", ); - Command::new("sh").arg("-c").arg(&commands).spawn().expect( - "command failed to start", - ); } }