fix(knowledge): canonicalize empty parent as current directory when compiling bare filename
This commit is contained in:
1 parent
e833898fb5
commit
b9fc9f1dbf
1 file changed
+1
@@ -27,6 +27,7 @@ pub fn extract_graph(opts: &ExtractOptions) -> Result<KnowledgeGraph> {
|
||||
let root = if opts.path.is_file() {
|
||||
opts.path
|
||||
.parent()
|
||||
.filter(|p| !p.as_os_str().is_empty())
|
||||
.map(|p| p.to_path_buf())
|
||||
.unwrap_or_else(|| PathBuf::from("."))
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user