-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcli.js
executable file
·42 lines (32 loc) · 948 Bytes
/
cli.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
38
39
40
41
42
#!/usr/bin/env node
'use strict';
/**
* Created by Jamey McElveen on 8/13/16.
*/
var path = require( 'path' ),
meow = require( 'meow' ),
//update = require( 'update-notifier' ),
main = require( './lib' );
const opts = {
usage: `
Usage:
kit [entry] [options]
Options:
--output, -o Dest file path
--version, -v Show the current version of kit command line tool.
--help, -h Show available commands.
For more complex configuration please head to https://github.com/egoist/bubleup#usage`,
alias: {
h: 'help', v: 'version', o: 'output'
}
};
const cli = meow( opts.usage, opts.usage );
//update( {pkg: cli.pkg} ).notify();
let pkg = {};
try {
pkg = require( path.join( process.cwd(), 'package.json' ) )
} catch ( _ ) {}
const options = Object.assign( {
entry: cli.input[0]
}, cli.flags, pkg && pkg.kit );
main( options );//.catch(e => console.log(e.stack))