add a tools directory including a "done-last-week" script #27
3 changed files with 34 additions and 0 deletions
4
tools/README.md
Normal file
4
tools/README.md
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
This directory contains small helper scripts and tools that are peripheral
|
||||||
|
or tangent to the main entomologist tool.
|
||||||
|
|
||||||
|
We make no guarantees about functionality or correctness.
|
||||||
|
|
|||||||
11
tools/done-last-week
Executable file
11
tools/done-last-week
Executable file
|
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
START=$(date --iso-8601=seconds --date='last monday - 1 week')
|
||||||
|
END=$(date --iso-8601=seconds --date='last monday')
|
||||||
|
|
||||||
|
#echo START=${START}
|
||||||
|
#echo END=${END}
|
||||||
|
|
||||||
|
ent list \
|
||||||
|
state=done \
|
||||||
|
done-time="${START}..${END}"
|
||||||
19
tools/set-done-time
Executable file
19
tools/set-done-time
Executable file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# This script finds all issues with state=Done which do not have a
|
||||||
|
# `done_time`.
|
||||||
|
#
|
||||||
|
# It sets each issue's `done_time` to the most recent time that the
|
||||||
|
# `state` was updated from the git log.
|
||||||
|
#
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
for ISSUE_ID in $(ent list state=done done-time=9999-01-01T00:00:00-06:00.. | grep ' ' | cut -f 1 -d ' '); do
|
||||||
|
echo ${ISSUE_ID}
|
||||||
|
UTIME=$(PAGER='' git log -n1 --pretty=format:%at%n entomologist-data -- ${ISSUE_ID}/state)
|
||||||
|
echo ${UTIME}
|
||||||
|
DATETIME=$(date --rfc-3339=seconds --date="@${UTIME}")
|
||||||
|
echo ${DATETIME}
|
||||||
|
ent done-time ${ISSUE_ID} "${DATETIME}"
|
||||||
|
done
|
||||||
Loading…
Add table
Add a link
Reference in a new issue
💥😎🔥