From 66f30b566e69f329b11ba84e21689c4cdfcf5992 Mon Sep 17 00:00:00 2001 From: Tony Brix Date: Sat, 13 Nov 2021 01:08:01 -0600 Subject: [PATCH] chore: fix building docs --- scripts/build-docs.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/build-docs.js b/scripts/build-docs.js index d1678d4..fb43400 100644 --- a/scripts/build-docs.js +++ b/scripts/build-docs.js @@ -7,7 +7,7 @@ const { highlight } = require('highlight.js') marked.use({ highlight: (code, lang) => { if (lang) { - return highlight(lang, code).value + return highlight(code, { language: lang }).value } return code @@ -100,7 +100,13 @@ async function createDocs () { const branding = path.join(docs, 'branding') const src = path.join(branding, 'public') - await fs.rmdir(dist, { recursive: true }) + try { + await fs.rm(dist, { recursive: true }) + } catch (ex) { + if (ex.code !== 'ENOENT') { + throw ex + } + } await copyRecursive(src, dist) const highlightjsStyles = path.resolve(__dirname, '..', 'node_modules', 'highlight.js', 'styles')