-
Notifications
You must be signed in to change notification settings - Fork 1
/
cli.js
42 lines (32 loc) · 812 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
/*
Written by Kevin Gravier <https://github.com/mrkmg>
Part of the node-docker-test project. <https://github.com/mrkmg/node-docker-test>
MIT Licence
*/
var Promise, Config, Run, Setup;
Promise = require('bluebird');
Config = require('./lib/utils/Config');
Run = require('./lib/actions/Run');
Setup = require('./lib/actions/Setup');
return Promise
.try(function () {
var config = Config.parse();
if (config.setup) {
return Setup(config);
}
else {
return Run(config);
}
})
.then(function () {
process.exit(0);
})
.catch(function (e) {
if (process.env.DEBUG) {
console.error(e);
}
else {
console.error(e.message);
}
process.exit(255);
});