Don't attempt to save index when there are no posts or profile details (complained about directory not existing)
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user