handle command not found

This commit is contained in:
♥ Minnie ♥ 2025-06-07 17:54:25 +08:00
parent 01b83996d1
commit 4eddaade35
Signed by: jasmine
GPG key ID: 8563E358D4E8040E

View file

@ -31,8 +31,9 @@ pub fn get_args(tokens: Vec<&str>) -> Vec<&str> {
pub fn execute(cmd: &str, args: Vec<&str>) { pub fn execute(cmd: &str, args: Vec<&str>) {
let status = Command::new(cmd) let status = Command::new(cmd)
.args(args) .args(args)
.status() .status();
.expect("failed to execute process");
assert!(status.success()); if status.is_err() {
println!("{}: command not found", cmd)
}
} }