mirror of
https://github.com/zadam/trilium.git
synced 2025-01-01 04:41:46 +08:00
fix import for tars generated outside of trilium
This commit is contained in:
parent
c7a609e349
commit
25f8df1e03
1 changed files with 7 additions and 2 deletions
|
@ -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];
|
||||
|
||||
|
|
Loading…
Reference in a new issue