wait for child process to finish

This commit is contained in:
♥ Minnie ♥ 2025-05-28 08:00:55 +08:00
parent 7390caacb0
commit 03b3b3088a
Signed by: jasmine
GPG key ID: 8563E358D4E8040E

View file

@ -28,10 +28,12 @@ fn get_args(v: Vec<&str>) -> Vec<&str> {
} }
fn run_command(cmd: String, args: Vec<&str>) { fn run_command(cmd: String, args: Vec<&str>) {
Command::new(cmd) let mut child = Command::new(cmd)
.args(args) .args(args)
.spawn() .spawn()
.expect("failed to execute process"); .expect("failed to execute process");
child.wait().expect("failed to wait on child");
} }
fn main() { fn main() {