-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The command to build the Kibana docs using the elastic/docs repo can be easy to forget, so this script is an easy to way to do it right every time.
- Loading branch information
Showing
3 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
require('../src/optimize/babel/register'); | ||
require('../src/docs/cli'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { execFileSync } from 'child_process'; | ||
import { resolve } from 'path'; | ||
|
||
const kibanaDir = resolve(__dirname, '..', '..'); | ||
const docsIndexFile = resolve(kibanaDir, 'docs', 'index.asciidoc'); | ||
const docsToolDir = resolve(kibanaDir, '..', 'docs'); | ||
const docsToolCmd = resolve(docsToolDir, 'build_docs.pl'); | ||
|
||
const args = process.argv.slice(2); | ||
|
||
try { | ||
execFileSync(docsToolCmd, ['--doc', docsIndexFile, '--chunk=1', ...args]); | ||
} catch (err) { | ||
if (err.code === 'ENOENT') { | ||
console.error(`elastic/docs repo must be cloned to ${docsToolDir}`); | ||
} else { | ||
console.error(err.stack); | ||
} | ||
|
||
process.exit(1); | ||
} |