Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

Commit 66f30b5

Browse files
committed
chore: fix building docs
1 parent 0cc7676 commit 66f30b5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

scripts/build-docs.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const { highlight } = require('highlight.js')
77
marked.use({
88
highlight: (code, lang) => {
99
if (lang) {
10-
return highlight(lang, code).value
10+
return highlight(code, { language: lang }).value
1111
}
1212

1313
return code
@@ -100,7 +100,13 @@ async function createDocs () {
100100
const branding = path.join(docs, 'branding')
101101
const src = path.join(branding, 'public')
102102

103-
await fs.rmdir(dist, { recursive: true })
103+
try {
104+
await fs.rm(dist, { recursive: true })
105+
} catch (ex) {
106+
if (ex.code !== 'ENOENT') {
107+
throw ex
108+
}
109+
}
104110
await copyRecursive(src, dist)
105111

106112
const highlightjsStyles = path.resolve(__dirname, '..', 'node_modules', 'highlight.js', 'styles')

0 commit comments

Comments
 (0)