From 03c1de559132c4b2c53152142fd3c40ba2f4f28c Mon Sep 17 00:00:00 2001 From: Adam Matthiesen Date: Mon, 4 Mar 2024 09:09:09 -0800 Subject: [PATCH] change `else { if() ` to `else if` --- packages/astro-ghostcms/src/astro-ghostcms.ts | 24 +++++-------------- 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/packages/astro-ghostcms/src/astro-ghostcms.ts b/packages/astro-ghostcms/src/astro-ghostcms.ts index 4ba0d5f1..44c1b8c3 100644 --- a/packages/astro-ghostcms/src/astro-ghostcms.ts +++ b/packages/astro-ghostcms/src/astro-ghostcms.ts @@ -136,30 +136,24 @@ export default defineIntegration({ verbose, }), ); - } else { - if (verbose) { + } else if (verbose) { GhostIntegrationLogger.info(c.gray("Theme Provider is disabled")); - } } // Satori OG Images if (options.enableOGImages) { addIntegration(ghostOGImages({ verbose })); - } else { - if (verbose) { + } else if (verbose) { GhostIntegrationLogger.info( c.gray("OG Image Provider is disabled"), ); - } } // RSS Feed if (options.enableRSSFeed) { addIntegration(ghostRSS({ verbose })); - } else { - if (verbose) { + } else if (verbose) { GhostIntegrationLogger.info(c.gray("RSS Feed is disabled")); - } } // @ASTROJS/SITEMAP @@ -172,14 +166,12 @@ export default defineIntegration({ ); } addIntegration(sitemap(options.Integrations?.sitemap)); - } else { - if (verbose) { + } else if (verbose) { GhostIntegrationLogger.info( c.gray( "@astrojs/sitemap integration already exists, skipping...", ), ); - } } // ASTRO-ROBOTS-TXT if (!hasIntegration("astro-robots-txt")) { @@ -191,14 +183,12 @@ export default defineIntegration({ ); } addIntegration(robotsTxt(options.Integrations?.robotsTxt)); - } else { - if (verbose) { + } else if (verbose) { GhostIntegrationLogger.info( c.gray( "astro-robots-txt integration already exists, skipping...", ), ); - } } // Set up default 404 page @@ -213,12 +203,10 @@ export default defineIntegration({ entrypoint: `${name}/404.astro`, prerender: true, }); - } else { - if (verbose) { + } else if (verbose) { GhostRouteLogger.info( c.gray("Default 404 page is disabled, Skipping..."), ); - } } // Add virtual imports for user configuration