-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·104 lines (76 loc) · 1.95 KB
/
cli.js
File metadata and controls
executable file
·104 lines (76 loc) · 1.95 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#!/usr/bin/env node
'use strict';
var config, routes, path
var fs = require('fs-extra'),
color = require('chalk'),
program = require('commander');
isGitowl()
program.version('0.1.0', '-v, --version').description('This cli helps you to manager GitOwl.')
var helps = require('./lib/helps.js'),
run = require('./lib/run.js'),
opt = require('./lib/opt.js'),
load = require('./lib/load.js');
function isGitowl(){
try {
fs.statSync('./gitowl.js')
} catch(e){
console.log(color.yellow('No documentation was found'))
process.exit(1)
}
}
program
.command('test')
.alias('t')
.description('Test GitOwl')
.action(run.test)
.on('--help', helps.test);
program
.command('install [cmd]')
.alias('i')
.description('Install GitOwl')
.action(run.install)
.on('--help', helps.install);
program
.command('routes [cmd]')
.alias('r')
.description('Automatic configure routes.')
.action(run.routes)
.on('--help', helps.routes);
program
.command('sitemap [cmd]')
.alias('s')
.description('Make a sitemap.')
.action(run.sitemap)
.on('--help', helps.sitemap);
program
.command('config [cmd]')
.alias('c')
.description('Configuration.')
.action(run.config)
.on('--help', helps.config);
program
.command('serve [cmd]')
.description('Make a server to show GitOwl.')
.action(run.serve)
.on('--help', helps.serve);
program
.command('view [cmd]')
.description('Show on console the documentation.')
.action(run.view)
.on('--help', helps.view);
// program
// .command('*', {isDefault: true})
// .description('Serve GitOwl. Defaul')
// .action(run.serve)
// .on('--help', helps.serve);
program.parse(process.argv);
if (process.argv.length == 2) {
run.serve()
}
/*
console.log('Selected:');
if (program.install) console.log(' - install');
if (program.routes) console.log(' - routes');
if (program.sitemap) console.log(' - sitemap');
console.log(' - %s config', program.config);
*/