mirror of
https://github.com/zadam/trilium.git
synced 2025-01-17 04:27:56 +08:00
tar file export now sets mtime to tar records based on utcDateCreated of a note, closes #487
This commit is contained in:
parent
a37b9cfc7b
commit
4f5b23fbf8
1 changed files with 11 additions and 2 deletions
|
@ -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 + '/');
|
||||
|
|
Loading…
Reference in a new issue