forked from NickUfer/web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.js
53 lines (47 loc) · 1.52 KB
/
build.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
const copydir = require('copy-dir')
const fs = require('fs')
;[
'./public/css',
'./public/docs',
'./public/en',
'./public/images',
'./public/img',
'./public/js',
'./public/versions',
].forEach(function(d) {
try {
fs.mkdirSync(d, { recursive: true })
} catch (e) {
console.log('Got error while creating dir', d, e.message)
}
})
;[
'keto',
'kratos',
'oathkeeper',
'hydra',
].forEach((project) => {
const dst = `./public/${project}/docs`
try {
fs.mkdirSync(dst, { recursive: true })
} catch (e) {
console.log('Got error while creating dir', dst, e.message)
}
const src = `./generated/docs/${project}/`
copydir.sync(src, dst)
// Workaround for https://github.com/facebook/docusaurus/issues/2537
// fse.copySync(`${src}index/index.html`, `${dst}/index.html`)
})
// It's time for v1 to die:
// copydir.sync('./generated/v1/docs/css', './public/css')
// copydir.sync('./generated/v1/docs/docs', './public/docs')
// copydir.sync('./generated/v1/docs/en', './public/en')
// copydir.sync('./generated/v1/docs/images', './public/images')
// copydir.sync('./generated/v1/docs/img', './public/img')
// copydir.sync('./generated/v1/docs/js', './public/js')
// copydir.sync('./generated/v1/docs/versions', './public/versions')
//
// fse.copySync('./generated/v1/docs/sitemap.xml', './public/docs/sitemap.xml')
// fse.copySync('./generated/v1/docs/versions.html', './public/docs/versions.html')
// ecosystem needs to be copied after v1 docs!
copydir.sync('./generated/docs/ecosystem', './public/docs')