From e41bc64548bbde8b848bd818d1b6becd8bb6f64b Mon Sep 17 00:00:00 2001 From: Adam Dehnel Date: Wed, 16 Sep 2026 09:23:49 -0500 Subject: [PATCH] chore: add more logging for publish command --- packages/cli/src/commands/publish.ts | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/cli/src/commands/publish.ts b/packages/cli/src/commands/publish.ts index 951fde4..9869973 100644 --- a/packages/cli/src/commands/publish.ts +++ b/packages/cli/src/commands/publish.ts @@ -297,26 +297,30 @@ export const publishCommand = command({ } } - log.message( - ` ${icon} ${post.frontmatter.title} (${reason})${bskyNote}`, - ); + log.message(` ${icon} ${post.frontmatter.title} (${reason})${bskyNote}`); if (verbose) { const postPath = resolvePostPath( post, config.pathPrefix, config.pathTemplate, ); - log.message(` Post URL: ${ config.siteUrl }${ postPath }`); + log.message(` Post URL: ${config.siteUrl}${postPath}`); if (post.frontmatter.ogImage) { - log.message( - post.coverImagePath - ? ` Resolved cover image for ${post.frontmatter.title}: ${post.frontmatter.ogImage}` - : ` Failed to resolve cover image for ${post.frontmatter.title}: ${post.frontmatter.ogImage}`, - ); + if (!post.coverImagePath) { + log.error( + ` Failed to resolve cover image for ${post.frontmatter.title}: ${post.frontmatter.ogImage}`, + ); + } else { + log.message( + ` Resolved cover image for ${post.frontmatter.title}: ${post.coverImagePath}`, + ); + } } - log.message(` Frontmatter:\n${ Object.entries(post.frontmatter) + log.message( + ` Frontmatter:\n${Object.entries(post.frontmatter) .map(([key, value]) => ` - ${key}: ${value}`) - .join("\n") }`); + .join("\n")}`, + ); } const postValid = await validatePost(post); isValid &&= postValid; -- 2.51.2