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
tar file export now sets mtime to tar records based on utcDateCreated of a note, closes #487
zadam4f5b23fbf818
diff --git a/src/services/export/tar.js b/src/services/export/tar.jsindex 7af704f2d4..4f90eb1afa 100644--- a/src/services/export/tar.js+++ b/src/services/export/tar.js@@ -2,6 +2,7 @@const html = require('html');const repository = require('../repository');+const dateUtils = require('../date_utils');const tar = require('tar-stream');const path = require('path');const mimeTypes = require('mime-types');@@ -270,7 +271,11 @@ ${content}if (noteMeta.dataFileName) {const content = prepareContent(noteMeta.title, await note.getContent(), noteMeta);- pack.entry({name: filePathPrefix + noteMeta.dataFileName, size: content.length}, content);+ pack.entry({+ name: filePathPrefix + noteMeta.dataFileName,+ size: content.length,+ mtime: dateUtils.parseDateTime(note.utcDateModified)+ }, content);}taskContext.increaseProgressCount();@@ -278,7 +283,11 @@ ${content}if (noteMeta.children && noteMeta.children.length > 0) {const directoryPath = filePathPrefix + noteMeta.dirFileName;- pack.entry({name: directoryPath, type: 'directory'});+ pack.entry({+ name: directoryPath,+ type: 'directory',+ mtime: dateUtils.parseDateTime(note.utcDateModified)+ });for (const childMeta of noteMeta.children) {await saveNote(childMeta, directoryPath + '/');