docs(appium): fix reference building script paths
MODIFY
packages/appium/docs/scripts/build-reference.js
packages/appium/docs/scripts/build-reference.js
@@ -5,7 +5,6 @@ const {fs} = require('@appium/support');
const {log, LANGS, DOCS_DIR} = require('./utils');
const path = require('path');
const monorepoRoot = path.resolve(__dirname, '..', '..', '..', '..');
-const {out: typedocOut} = JSON.parse(fs.readFileSync(path.join(monorepoRoot, 'typedoc.json')));
const {exec} = require('teen_process');
const typedocMap = [[['commands', 'appium_base_driver.md'], ['base_driver.md']]];
@@ -14,12 +13,14 @@ async function main() {
log.info('Generating typedoc reference material');
await exec('npm', ['run', 'typedoc'], {cwd: monorepoRoot});
+ const {out: typedocOut} = JSON.parse(await fs.readFile(path.join(monorepoRoot, 'typedoc.json')));
+
for (const lang of LANGS) {
const langRefPath = path.resolve(DOCS_DIR, lang, 'reference');
await fs.rimraf(langRefPath);
await fs.mkdirp(langRefPath);
for (const [from, to] of typedocMap) {
- const sourcePath = path.resolve(typedocOut, ...from);
+ const sourcePath = path.resolve(monorepoRoot, typedocOut, ...from);
const destPath = path.resolve(langRefPath, ...to);
log.info(`Copying ${sourcePath} to ${destPath}`);
await fs.copyFile(sourcePath, destPath);

docs(appium): fix reference building script paths