From ca8e3075b0231604fde0b1a0cf7d47d0dc3cded7 Mon Sep 17 00:00:00 2001 From: addetz <43963729+addetz@users.noreply.github.com> Date: Tue, 12 Nov 2024 13:52:31 +0000 Subject: [PATCH] docs: add directory creation to writeResponseFile --- plugins/packs-integrations.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/packs-integrations.js b/plugins/packs-integrations.js index b0f33994e27..6f799a4e8be 100644 --- a/plugins/packs-integrations.js +++ b/plugins/packs-integrations.js @@ -405,6 +405,9 @@ async function getLogoUrl(packsAllData, logoUrlMap) { } async function writeResponseFile(path, apiResponse) { + if (!existsSync(dirname)) { + mkdirSync(dirname, { recursive: true }); + } open(path, "w+", (err, fd) => { if (err) { logger.error("An error occurred while opening the JSON file:", err); @@ -471,9 +474,6 @@ async function pluginPacksAndIntegrationsData(context, options) { let apiPackResponse = {}; let logoUrlMap = {}; if (!isPackFileExists) { - if (!existsSync(dirname)) { - mkdirSync(dirname, { recursive: true }); - } logger.info("Fetching the list of packs from the Palette API"); let packDataArr = await fetchPackListItems(`?limit=${filterLimit}`, [], 0, mappedRepos);