Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions gendocs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env zx

let _ROOT = await $`pwd`
_ROOT = _ROOT.stdout;

const objPackages = str => `{"packages": ${str}}`

let stdOut = await $`lerna list --json`

const {packages} = JSON.parse(
objPackages(
stdOut.stdout.trim()
)
)

const gen = async packages => {
packages.forEach(async _package => {
let {location, name} = _package;
await $`cd ${location} && yarn bsdoc build ${name}`
})
}

const copyTo = (pacakages, to) => {
packages.forEach( async _package => {
let {location, name} = _package;
await $`cp -r ${location}/docs/**/* ${to}`
})
}

await gen(packages)
await copyTo(packages, _ROOT.trim() + "/docs/")