forked from kriskbx/gitlab-time-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgtt-status.js
More file actions
26 lines (21 loc) · 910 Bytes
/
gtt-status.js
File metadata and controls
26 lines (21 loc) · 910 Bytes
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
const program = require('commander');
const colors = require('colors');
const moment = require('moment');
const Frame = require('./models/frame');
const Config = require('./include/file-config');
const Cli = require('./include/cli');
const Fs = require('./include/filesystem');
program.parse(process.argv);
let config = new Config(__dirname);
Fs.find(`"stop": false`, config.frameDir)
.then(frames => {
if (frames.length === 0) {
console.log('No projects are started right now.');
return;
}
frames.forEach(file => {
let frame = Frame.fromFile(config, file);
console.log(`Project ${frame.project.magenta} ${frame.resource.type.blue} ${('#' + frame.resource.id).blue} is running, started ${moment(frame.start).fromNow().green} (id: ${frame.id})`);
});
})
.catch(error => Cli.error('Could not read frames.', error));