forked from kriskbx/gitlab-time-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgtt-resume.js
More file actions
executable file
·24 lines (18 loc) · 784 Bytes
/
gtt-resume.js
File metadata and controls
executable file
·24 lines (18 loc) · 784 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
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
.arguments('[project]')
.option('--verbose', 'show verbose output')
.parse(process.argv);
Cli.verbose = program.verbose;
let config = new Config(process.cwd()).set('project', program.args[0]),
tasks = new Tasks(config);
if (!config.get('project'))
Cli.error('No project set');
tasks.resume()
.then(frame => console.log(`Starting project ${config.get('project').magenta} ${frame.resource.type.blue} ${('#' + frame.resource.id).blue} at ${moment().format('HH:mm').green}`))
.catch(error => Cli.error(error));