-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmr.js
More file actions
45 lines (38 loc) · 863 Bytes
/
mr.js
File metadata and controls
45 lines (38 loc) · 863 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
37
38
39
40
41
42
43
44
45
#! /usr/bin/env node
const ParsedArgs = require('./lib/ParsedArgs')
const MrCommand = require('./lib/MrCommand')
const RunCommand = require('./lib/RunCommand')
const NodeVersion = require('./lib/NodeVersion')
const pkg = require('./package.json')
const main = async (argv) => {
await new RunCommand (
await MrCommand.withParsedArgs(
new ParsedArgs (
argv
)
).todo ()
).run ()
}
module.exports = {
main
}
const nodeVersion = new NodeVersion(pkg.engines, process.versions.node)
if (!nodeVersion.isValid()) {
console.error(nodeVersion.toError())
process.exit(1)
}
// eslint-disable-next-line no-floating-promise/no-floating-promise
; (async () => {
if (global.FUZZ) {
return
}
try {
await main (process.argv.slice (2))
} catch (x) {
const msg = x.toString().trim()
if (msg) {
console.error(msg)
}
process.exit(1)
}
})()