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>) {
let status = Command::new(cmd)
.args(args)
.status()
.expect("failed to execute process");
.status();
assert!(status.success());
if status.is_err() {
println!("{}: command not found", cmd)
}
}