From 350a2dc1dc462972bf561db31d55fdfe99f01b5f Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Wed, 11 Sep 2024 05:16:58 +0200 Subject: [PATCH] Fixed username in save message. --- src/save/writeToIndex.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/save/writeToIndex.js b/src/save/writeToIndex.js index 1c182c4..a8b1898 100644 --- a/src/save/writeToIndex.js +++ b/src/save/writeToIndex.js @@ -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; } }