mirror of
https://github.com/sajenim/rush.git
synced 2025-06-28 09:54:21 +08:00
handle command not found
This commit is contained in:
parent
01b83996d1
commit
4eddaade35
1 changed files with 4 additions and 3 deletions
|
@ -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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue