handle case where path is a directory
This commit is contained in:
parent
44b3b7dbc6
commit
138a792a69
1 changed files with 5 additions and 0 deletions
|
@ -32,6 +32,11 @@ fn resolve_with_location(
|
|||
};
|
||||
|
||||
let path = base.join(PathBuf::from(source));
|
||||
|
||||
if path.is_dir() {
|
||||
return Err(io::Error::new(io::ErrorKind::Other, "Not a file"));
|
||||
}
|
||||
|
||||
let (next_location, alias) = generate_next_parameters(&path)?;
|
||||
|
||||
File::open(path).and_then(|f| Ok((BufReader::new(f), next_location, alias)))
|
||||
|
|
Loading…
Reference in a new issue