-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·36 lines (30 loc) · 747 Bytes
/
cli.js
File metadata and controls
executable file
·36 lines (30 loc) · 747 Bytes
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
#!/usr/bin/env node
const meow = require('meow')
const B2f = require('.')
const cli = meow(`
Usage:
b2f [baseDir] [options]
Commands:
baseDir Specify the input path, which includes 'boostnote.json' ( default: process.cwd() )
Options:
--output, -o Specify the output path ( default: ./out )
--version Output version number
--help Output usage information
`, {
flags: {
output: {
type: 'string',
default: './out',
alias: 'o'
}
}
})
const config = {
inputPath: cli.input[0] || null,
outputPath: cli.flags.output || null
}
if (cli.flags.output === true) {
console.error(`Value for 'output' of type '[String]' required.`)
} else {
new B2f(config).run()
}