builtins : code de cd plus lisible
This commit is contained in:
parent
d162a24db0
commit
2337bd3127
1 changed files with 1 additions and 5 deletions
|
@ -17,7 +17,7 @@ pub(super) fn cd(args: &Vec<String>) -> ExitCode {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let exit_code: ExitCode;
|
let mut exit_code = ExitCode::success();
|
||||||
if path.is_some() {
|
if path.is_some() {
|
||||||
let path = path.unwrap();
|
let path = path.unwrap();
|
||||||
let result = set_current_dir(&path);
|
let result = set_current_dir(&path);
|
||||||
|
@ -26,11 +26,7 @@ pub(super) fn cd(args: &Vec<String>) -> ExitCode {
|
||||||
let error = CdError::new(&args[0]);
|
let error = CdError::new(&args[0]);
|
||||||
error::print(Box::new(error));
|
error::print(Box::new(error));
|
||||||
exit_code = ExitCode::new(2);
|
exit_code = ExitCode::new(2);
|
||||||
} else {
|
|
||||||
exit_code = ExitCode::success();
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
exit_code = ExitCode::success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exit_code
|
exit_code
|
||||||
|
|
Loading…
Reference in a new issue