This repository has been archived by the owner on Oct 6, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
37 lines (33 loc) · 1.57 KB
/
index.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
import Build from './lib/build'
import pkg from '../package.json'
const COMMAND_NAME = 'wdio'
const COMMAND_ALIAS = 'b'
const COMMAND_USAGE = '<argument> [option]'
hexo.extend.console.register(COMMAND_NAME, pkg.description, {
alias: COMMAND_ALIAS,
usage: COMMAND_USAGE,
arguments: [
{ name: 'build', desc: 'kicks off complete build process' },
{ name: 'clean', desc: 'clean public folder, markdown files and node_modules directory' },
{ name: 'install', desc: 'installs page dependencies' },
{ name: 'getDocs', desc: 'copies over markdown files from webdriverio package' },
{ name: 'generateActionCommands', desc: 'generate action commands with wddoc' },
{ name: 'generateProtocolCommands', desc: 'generate protocol commands with wddoc' },
{ name: 'generateMarkdown', desc: 'generates markdown files from webdriverio package' },
{ name: 'compass', desc: 'compiles sass files' },
{ name: 'generate', desc: 'generate page with hexo' },
{ name: 'compressCSS', desc: 'minifies CSS' },
{ name: 'compressJS', desc: 'minifies JS' },
{ name: 'pkgInstall', desc: 'downloads and extracts package from NPM or GitHub' },
{ name: 'webmastertools', desc: 'generates webmastertools verification' }
]
}, async (command) => {
let args = arguments[5].env.args._
let params = []
let opts = Object.assign(arguments[5].env.args, arguments[5].config.wdio)
if (args.length > 1) {
params = args.slice(1)
}
let build = new Build(command, opts, hexo)
await build.run(params)
})