Logging refactor, quote-date, type count fix

This commit is contained in:
Will Boyd
2025-02-06 13:56:27 -05:00
parent 9fb7ae47c5
commit df5731985d
3 changed files with 29 additions and 8 deletions
+2 -5
View File
@@ -62,16 +62,13 @@ function collectPosts(channelData, postTypes, config) {
.filter(postData => !(postType === 'page' && postData.post_name[0] === 'sample-page'))
.map(postData => buildPost(postData, turndownService, config));
if (postTypes.length > 1) {
console.log(`${postsForType.length} "${postType}" posts found.`);
if (postsForType.length > 0) {
console.log(`${postsForType.length} posts of type "${postType}" found.`);
}
allPosts.push(...postsForType);
});
if (postTypes.length === 1) {
console.log(allPosts.length + ' posts found.');
}
return allPosts;
}