mirror of
https://github.com/nushell/nushell
synced 2025-01-27 20:35:43 +00:00
Fix set_pwd() return Result logic.
This commit is contained in:
parent
569929983c
commit
1057e648b0
1 changed files with 11 additions and 7 deletions
|
@ -81,7 +81,10 @@ pub mod windows {
|
||||||
Ok(path_string) => {
|
Ok(path_string) => {
|
||||||
if let Some(drive) = extract_drive_letter(&path_string) {
|
if let Some(drive) = extract_drive_letter(&path_string) {
|
||||||
maintainer.maintain(env_var_for_drive(drive), value.clone());
|
maintainer.maintain(env_var_for_drive(drive), value.clone());
|
||||||
}
|
Ok(())
|
||||||
|
} else if path_string.is_empty() {
|
||||||
|
Ok(())
|
||||||
|
} else {
|
||||||
// Other path format, like UNC Network share path, or bash format
|
// Other path format, like UNC Network share path, or bash format
|
||||||
// /c/Users/nushell will be supported later.
|
// /c/Users/nushell will be supported later.
|
||||||
Err(ShellError::InvalidValue {
|
Err(ShellError::InvalidValue {
|
||||||
|
@ -90,6 +93,7 @@ pub mod windows {
|
||||||
span: Span::unknown(),
|
span: Span::unknown(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Err(e) => Err(ShellError::InvalidValue {
|
Err(e) => Err(ShellError::InvalidValue {
|
||||||
valid: "$env.PWD should have String type and String::from_value() should be OK()."
|
valid: "$env.PWD should have String type and String::from_value() should be OK()."
|
||||||
.into(),
|
.into(),
|
||||||
|
|
Loading…
Reference in a new issue