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];