mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 23:44:52 +02:00
Filesystem shell can't cd into files. Ever.
This commit is contained in:
@ -187,6 +187,14 @@ impl Shell for FilesystemShell {
|
||||
} else {
|
||||
let path = PathBuf::from(self.path());
|
||||
|
||||
if target.exists() && !target.is_dir() {
|
||||
return Err(ShellError::labeled_error(
|
||||
"Can not change to directory",
|
||||
"is not a directory",
|
||||
v.tag().clone(),
|
||||
));
|
||||
}
|
||||
|
||||
match dunce::canonicalize(path.join(&target)) {
|
||||
Ok(p) => p,
|
||||
Err(_) => {
|
||||
|
Reference in New Issue
Block a user