-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstandup
More file actions
executable file
·26 lines (21 loc) · 1.05 KB
/
standup
File metadata and controls
executable file
·26 lines (21 loc) · 1.05 KB
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
#!/usr/bin/env bash
# Format `watson log` output for daily standup
## Expected format is each task on its own line, stripped of punctuation:
# new feature
# fix bug
# clean up code
# 0 is Sunday, 1 is Monday, etc.
current_weekday=$(gdate +"%w")
# use Friday if it's Sunday or Monday, otherwise use yesterday
if test "$current_weekday" -eq 0; then
last_workday="-2";
elif test "$current_weekday" -eq 1; then
last_workday="-3";
else last_workday="-1";
fi
watson log -f $(gdate -d "$last_workday days" +"%Y/%m/%d") | # get time log for yesterday
grep -o "\[.*\]" | # find time periods tracked (enclosed in brackets)
tr -d '[]' | # remove brackets
tr ',' '\n' | # split up multi-task time periods into own lines
perl -pe 's/^\s*//g' | # strip extra whitespace at the beginning of lines
awk '!seen[$0]++' # remove duplicates