Don't attempt to save index when there are no posts or profile details (complained about directory not existing)

This commit is contained in:
2024-09-11 05:16:56 +02:00
parent 44cdd37e49
commit a68493d0fa
2 changed files with 4 additions and 4 deletions

View File

@@ -29,6 +29,10 @@ async function writeToIndex(posts, profilePaths, user) {
posts: newAndUpdatedEntries.concat(user.indexed.original),
};
if (!data.profile.image && !data.profile.description && !data.posts.length) {
return;
}
return fs.writeFile(filename, yaml.safeDump(data));
}