mirror of
https://github.com/nushell/nushell
synced 2025-01-14 14:14:13 +00:00
Enter now requires a directory (#761)
This commit is contained in:
parent
9b128b7a03
commit
283a615ecc
1 changed files with 7 additions and 0 deletions
|
@ -41,6 +41,13 @@ impl Command for Enter {
|
|||
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 new_path = nu_path::canonicalize_with(new_path, &cwd)?;
|
||||
|
||||
|
|
Loading…
Reference in a new issue