From 92e812567234ef1fb0afbea09b9a0c1d9bf4cead Mon Sep 17 00:00:00 2001 From: Sean Kovacs Date: Thu, 29 Apr 2021 20:00:32 -0400 Subject: [PATCH] fixed issue where the output dir wasn't being created --- package.json | 2 +- src/gatsby-node.js | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 0290c26..b8d9141 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "gatsby-plugin-guru-export", "description": "Creates an Guru export for your Gatsby site.", - "version": "0.2.0", + "version": "0.2.1", "author": "Sean Kovacs ", "bugs": { "url": "https://github.com/calendly/gatsby-plugin-guru-export" diff --git a/src/gatsby-node.js b/src/gatsby-node.js index e6f7fa0..5cddaec 100755 --- a/src/gatsby-node.js +++ b/src/gatsby-node.js @@ -38,10 +38,7 @@ exports.onPostBuild = async ({ graphql }, pluginOptions) => { const feedData = serialize({ query }); const outputPath = path.join(publicPath, output); - const outputDir = path.dirname(outputPath); - if (!(await fs.exists(outputDir))) { - await fs.mkdirp(outputDir); - } + await fs.ensureDir(outputPath); for (let i = 0; i < feedData.length; i++) { const data = feedData[i];