Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix import for tars generated outside of trilium
azivner25f8df1e0359
diff --git a/src/routes/api/import.js b/src/routes/api/import.jsindex 7469c44c67..09b8887648 100644--- a/src/routes/api/import.js+++ b/src/routes/api/import.js@@ -151,10 +151,15 @@ async function parseImportFile(file) {if (header.type === 'file') {({name, key} = getFileName(header.name));}- else {- name = header.name;+ else if (header.type === 'directory') {+ // directory entries in tar often end with directory separator+ name = (header.name.endsWith("/") || header.name.endsWith("\\")) ? header.name.substr(0, header.name.length - 1) : header.name;key = 'directory';}+ else {+ log.error("Unrecognized tar entry: " + JSON.stringify(header));+ return;+ }let file = fileMap[name];