From 03b3b3088a7e3e77397fd43ff5f391708fd316fc Mon Sep 17 00:00:00 2001 From: jasmine Date: Wed, 28 May 2025 08:00:55 +0800 Subject: [PATCH] wait for child process to finish --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index a7f2d87..3eea37b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -28,10 +28,12 @@ fn get_args(v: Vec<&str>) -> Vec<&str> { } fn run_command(cmd: String, args: Vec<&str>) { - Command::new(cmd) + let mut child = Command::new(cmd) .args(args) .spawn() .expect("failed to execute process"); + + child.wait().expect("failed to wait on child"); } fn main() {