Skip to content

Commit

Permalink
docs: add directory creation to writeResponseFile
Browse files Browse the repository at this point in the history
  • Loading branch information
addetz committed Nov 12, 2024
1 parent 6c0d8be commit ca8e307
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/packs-integrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit ca8e307

Please sign in to comment.