-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathgtt-stop.js
executable file
·27 lines (21 loc) · 987 Bytes
/
gtt-stop.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
const program = require('commander');
const colors = require('colors');
const moment = require('moment');
const Config = require('./include/file-config');
const Cli = require('./include/cli');
const Tasks = require('./include/tasks');
program
.option('--verbose', 'show verbose output')
.parse(process.argv);
Cli.verbose = program.verbose;
let config = new Config(__dirname),
tasks = new Tasks(config);
tasks.stop()
.then(frames => {
frames.forEach(frame => {
if(!frame.resource.new)
return console.log(`Stopping project ${frame.project.magenta} ${frame.resource.type.blue} ${('#' + frame.resource.id).blue}, started ${moment(frame.start).fromNow().green} (id: ${frame.id})`)
console.log(`Stopping project ${frame.project.magenta} for new ${frame.resource.type} "${(frame.resource.id).blue}", started ${moment(frame.start).fromNow().green} (id: ${frame.id})`)
});
})
.catch(error => Cli.error(error));