Skip to content
Snippets Groups Projects
Verified Commit fd66ef99 authored by Isabella Skořepová's avatar Isabella Skořepová
Browse files

Fix no merge warning + fix modification date

parent 5e2e4def
No related branches found
No related tags found
No related merge requests found
......@@ -183,14 +183,18 @@ module.exports = function(obj) {
article.metadata.date = {};
if(article.metadata.date.creation === undefined) {
if(mergeCommit === undefined)
if(mergeCommit === undefined) {
console.log('[Warning] Article '+ file +' does not have merge commit.');
article.metadata.date.creation = moment();
else
} else
article.metadata.date.creation = mergeCommit.date;
}
article.metadata.date.modification = newestCommit.date;
article.metadata.date.modified = (newestCommit !== oldestCommit);
var sameDay = function(a,b) {
return a.getYear()==b.getYear() && a.getMonth() == b.getMonth() && a.getDate() == b.getDate();
}
article.metadata.date.modified = !sameDay(newestCommit.date, oldestCommit.date);
if(article.metadata.author === undefined)
article.metadata.author = {}
......@@ -201,7 +205,7 @@ module.exports = function(obj) {
article.commits = commits;
} else {
console.log('[Warning] Article '+ file +' is not in git repository or doesn\'t have merge commit');
console.log('[Warning] Article '+ file +' is not in git repository.');
}
});
return obj;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment