-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
nw
executable file
·68 lines (56 loc) · 1.24 KB
/
nw
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env node
'use strict'
/**
* Module dependencies
*/
const cli = require('commander')
const update = require('update-notifier')
const pkg = require('./package')
require('colorful').toxic()
/**
* Commands
*/
const install = require('./lib/install')
const run = require('./lib/run')
const use = require('./lib/use')
const list = require('./lib/list')
const listRemote = require('./lib/list-remote')
const remove = require('./lib/remove')
/**
* Update notify
*/
update({pkg}).notify()
cli.version(pkg.version)
cli
.command('*')
.description('Run nwjs in a directory')
.action(run)
cli
.command('install <version>')
.description('Install an nwjs version')
.alias('i')
.action(install)
cli
.command('use <version>')
.description('Set an active nwjs version')
.alias('u')
.action(use)
cli
.command('list')
.description('List local cached nwjs versions')
.alias('ls')
.action(list)
cli
.command('list-remote')
.description('List all available nwjs versions from remote')
.alias('ls-remote')
.action(listRemote)
cli
.command('remove <version>')
.description('Remove a specific version of nwjs')
.alias('r')
.action(remove)
const inst = cli.parse(process.argv)
if(!inst.args.length) {
cli.outputHelp()
}