fix(knowledge): canonicalize empty parent as current directory when compiling bare filename

This commit is contained in:
cflmy committed 2026-11-18 13:36:20 +08:00
1 parent e833898fb5
commit b9fc9f1dbf
1 file changed
+1
+1
View File
@@ -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 {