You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
console.log(`Cancel project ${frame.project.magenta}${frame.resource.type.blue}${('#'+frame.resource.id).blue}, started ${moment(frame.start).fromNow().green}`);
22
-
});
20
+
frames.forEach(frame=>console.log(`Cancel project ${frame.project.magenta}${frame.resource.type.blue}${('#'+frame.resource.id).blue}, started ${moment(frame.start).fromNow().green}`))
23
21
})
24
-
.catch(error=>Cli.error('Could not read frames.',error));
console.log(` ${frame.id}${moment(frame.start).format('HH:mm').green} to ${moment(frame.stop).format('HH:mm').green}\t${toHumanReadable(frame.duration)}\t\t${frame.project.magenta}\t\t${(frame.resource.type+' #'+frame.resource.id).blue}`)
42
-
});
43
-
});
23
+
tasks.log()
24
+
.then(({frames, times})=>{
25
+
Object.keys(frames).sort().forEach(date=>{
26
+
if(!frames.hasOwnProperty(date))return;
27
+
28
+
console.log(`${moment(date).format('MMMM Do YYYY')} (${toHumanReadable(times[date])})`.green);
console.log(` ${frame.id}${moment(frame.start).format('HH:mm').green} to ${moment(frame.stop).format('HH:mm').green}\t${toHumanReadable(frame.duration)}\t\t${frame.project.magenta}\t\t${(frame.resource.type+' #'+frame.resource.id).blue}`)
Copy file name to clipboardExpand all lines: gtt-status.js
+11-9Lines changed: 11 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -2,25 +2,27 @@ const program = require('commander');
2
2
constcolors=require('colors');
3
3
constmoment=require('moment');
4
4
5
-
constFrame=require('./models/frame');
6
5
constConfig=require('./include/file-config');
7
6
constCli=require('./include/cli');
8
-
constFs=require('./include/filesystem');
7
+
constTasks=require('./include/tasks');
9
8
10
-
program.parse(process.argv);
11
9
12
-
letconfig=newConfig(__dirname);
10
+
program
11
+
.option('--verbose','show verbose output')
12
+
.parse(process.argv);
13
13
14
-
Fs.find(`"stop": false`,config.frameDir)
14
+
Cli.verbose=program.verbose;
15
+
16
+
letconfig=newConfig(__dirname),
17
+
tasks=newTasks(config);
18
+
19
+
tasks.status()
15
20
.then(frames=>{
16
21
if(frames.length===0){
17
22
console.log('No projects are started right now.');
18
23
return;
19
24
}
20
25
21
-
frames.forEach(file=>{
22
-
letframe=Frame.fromFile(config,file);
23
-
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})`);
24
-
});
26
+
frames.forEach(frame=>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})`));
25
27
})
26
28
.catch(error=>Cli.error('Could not read frames.',error));
0 commit comments