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

This commit is contained in:
2018-07-02 19:55:21 +02:00
parent 7fd3f1c01b
commit 310931e4f8
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));
}