forked from medusajs/medusa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-site.js
executable file
·43 lines (35 loc) · 915 Bytes
/
build-site.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
#!/usr/bin/env node
const execa = require("execa")
const installDeps = async () => {
await execa("yarn", ["install"], {
cwd: "./reference",
stdio: "inherit",
})
await execa("yarn", ["install"], {
cwd: "./docs",
stdio: "inherit",
})
}
const buildGatsby = async () => {
await execa("./node_modules/.bin/gatsby", ["build"], {
cwd: "./reference",
stdio: "inherit",
})
}
const buildDocusaurus = async () => {
await execa("./node_modules/.bin/docusaurus", ["build"], {
cwd: "./docs",
stdio: "inherit",
})
}
const buildSite = async () => {
await installDeps()
await buildGatsby()
await buildDocusaurus()
await execa("rm", ["-rf", "build"])
await execa("mkdir", ["build"])
await execa("cp", ["_redirects", "build/_redirects"])
await execa("cp", ["-a", `reference/public/.`, `build/`])
await execa("cp", ["-a", `docs/build/.`, `build/`])
}
buildSite()