mirror of
https://github.com/nushell/nushell.git
synced 2025-01-05 22:09:28 +01:00
Enter now requires a directory (#761)
This commit is contained in:
parent
9b128b7a03
commit
283a615ecc
@ -41,6 +41,13 @@ impl Command for Enter {
|
|||||||
return Err(ShellError::DirectoryNotFound(path_span));
|
return Err(ShellError::DirectoryNotFound(path_span));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !new_path.is_dir() {
|
||||||
|
return Err(ShellError::DirectoryNotFoundCustom(
|
||||||
|
"not a directory".to_string(),
|
||||||
|
path_span,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
let cwd = current_dir(engine_state, stack)?;
|
let cwd = current_dir(engine_state, stack)?;
|
||||||
let new_path = nu_path::canonicalize_with(new_path, &cwd)?;
|
let new_path = nu_path::canonicalize_with(new_path, &cwd)?;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user