Skip to content

Commit

Permalink
[plugin-typography] Ensure the .cache directory is created
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Aug 1, 2017
1 parent 7e36b69 commit 6671525
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/gatsby-plugin-typography/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,11 @@ const typography = new Typography()
module.exports typography`
}

fs.writeFileSync(`${__dirname}/.cache/typography.js`, module)
const dir = `${__dirname}/.cache`

if (!fs.existsSync(dir)) {
fs.mkdirSync(dir)
}

fs.writeFileSync(`${dir}/typography.js`, module)
}

0 comments on commit 6671525

Please sign in to comment.