add lint-docs script
This commit is contained in:
parent
01fa9827b4
commit
3a5bf51d1d
2 changed files with 20 additions and 0 deletions
|
@ -4,6 +4,7 @@
|
|||
"devDependencies": {
|
||||
"asar": "^0.11.0",
|
||||
"electabul": "~0.0.4",
|
||||
"electron-docs-linter": "^1.0.1",
|
||||
"request": "*",
|
||||
"standard": "^7.1.2",
|
||||
"standard-markdown": "^1.2.1"
|
||||
|
|
19
script/lint-docs.js
Executable file
19
script/lint-docs.js
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const lint = require('electron-docs-linter')
|
||||
const args = process.argv.slice(2)
|
||||
const docsPath = path.join(__dirname, '../docs/api')
|
||||
const targetVersion = args[0]
|
||||
const outFile = path.join(__dirname, '../electron.json')
|
||||
|
||||
if (!targetVersion) {
|
||||
console.error(`Usage: ./script/lint-docs.js <targetVersion>`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
lint(docsPath, targetVersion).then(function(apis) {
|
||||
fs.writeFileSync(outFile, JSON.stringify(apis, null, 2))
|
||||
console.log(`Wrote ${outFile}`)
|
||||
})
|
Loading…
Reference in a new issue