-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.js
52 lines (38 loc) · 880 Bytes
/
index.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
43
44
45
46
47
48
49
50
51
52
'use strict';
// Deps
const path = require('path');
const App = require('./lib/app');
const Vorpal = require('vorpal');
const updateNotifier = require('update-notifier');
const pkg = require('./package.json');
// Init vorpal instance
const vorpal = Vorpal();
// Notify about module updates
updateNotifier({ pkg: pkg, updateCheckInterval: 0 }).notify({ defer: false });
// Init App
const app = App({
CWD: process.cwd(),
configFile: process.argv[2],
logger: vorpal.log.bind(vorpal)
});
// RegisterVorpal-Plugins
// Commands
[
'ps',
'reload',
'start',
'stop',
'restart',
'images',
'exit',
'monitor',
'start-script',
'stop-script',
].forEach( registerCMD );
// Final configs
vorpal
.delimiter('node-compose $')
.show();
function registerCMD(name) {
vorpal.use( require( path.join(__dirname, 'lib', 'vorpal-plugins', 'commands', name) ), { app: app });
}