forked from napi-rs/napi-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
40 lines (34 loc) · 969 Bytes
/
index.ts
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
import 'core-js/es/string/replace-all'
import { Cli } from 'clipanion'
import { version } from '../package.json'
import { ArtifactsCommand } from './artifacts'
import { BuildCommand } from './build'
import { CreateNpmDirCommand } from './create-npm-dir'
import { HelpCommand } from './help'
import { NewProjectCommand } from './new'
import { PrePublishCommand } from './pre-publish'
import { RenameCommand } from './rename'
import { VersionCommand } from './version'
const cli = new Cli({
binaryName: 'napi',
binaryVersion: version,
})
cli.register(ArtifactsCommand)
cli.register(BuildCommand)
cli.register(CreateNpmDirCommand)
cli.register(PrePublishCommand)
cli.register(VersionCommand)
cli.register(NewProjectCommand)
cli.register(RenameCommand)
cli.register(HelpCommand)
cli
.run(process.argv.slice(2), {
...Cli.defaultContext,
})
.then((status) => {
process.exit(status)
})
.catch((e) => {
console.error(e)
process.exit(1)
})