Added watch-mode. Waiting for profile detail write to finalize before new watch cycle and capture details in index file.
This commit is contained in:
@@ -16,7 +16,7 @@ async function getIndexedPosts(user) {
|
||||
} catch (error) {
|
||||
console.log('\x1b[33m%s\x1b[0m', `Could not load index file for '${user.name}' at '${indexFilePath}': ${error}`);
|
||||
|
||||
return [];
|
||||
return { profile: { image: null, description: null }, posts: [] };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ function getUserPostsWrap(reddit, args) {
|
||||
getPosts(username, reddit, args),
|
||||
]);
|
||||
|
||||
const indexed = await getIndexedPosts(user);
|
||||
const { posts: indexed } = await getIndexedPosts(user);
|
||||
|
||||
if (args.archives) {
|
||||
posts.push(...await getArchivedPosts(username, posts, reddit));
|
||||
|
||||
Reference in New Issue
Block a user