Fixed username in save message.

This commit is contained in:
ThePendulum 2021-12-18 00:40:12 +01:00
parent d8059b4173
commit 35ca8ccdd1
1 changed files with 7 additions and 2 deletions

View File

@ -47,10 +47,15 @@ async function writeToIndex(posts, profilePaths, user, args) {
try {
const yamlIndex = yaml.safeDump(data);
const saved = await save(filepath, Buffer.from(yamlIndex, 'utf8'));
return save(filepath, Buffer.from(yamlIndex, 'utf8'));
console.log(user);
logger.info(`Saved index with ${posts.length} new posts for ${user.name}`);
return saved;
} catch (error) {
logger.error(`Could not save index for ${user.username}: ${error.message}`);
logger.error(`Could not save index for ${user.name}: ${error.message}`);
return null;
}
}