mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Unittest - Replace the timestamp function on wrapper.sh
* %N is not supported by /bin/date on BSD systems
This commit is contained in:
parent
75a2b11638
commit
e845a25ea6
2 changed files with 2 additions and 2 deletions
|
@ -441,7 +441,7 @@ class LoggedHook(Hook):
|
|||
for k1 in log:
|
||||
# Timestamps
|
||||
if k1 == "calls":
|
||||
timestamp = lambda x: datetime.fromtimestamp(int(x) / 1e9)
|
||||
timestamp = lambda x: datetime.fromtimestamp(float(x))
|
||||
newlog[k1] = map(timestamp, log[k1])
|
||||
|
||||
elif k1 in ("input", "output"):
|
||||
|
|
|
@ -6,7 +6,7 @@ IN="${ORIGINALHOOK}.log.in"
|
|||
OUT="${ORIGINALHOOK}.log.out"
|
||||
|
||||
# Let it know that we were executed
|
||||
echo "% Called at $(date +%s%N)" >> ${IN}
|
||||
echo "% Called at $(python -c 'import time; print(time.time())')" >> ${IN}
|
||||
|
||||
# Log what arrives via stdin to ${IN} and what comes via stdout to ${OUT}
|
||||
$ORIGINALHOOK < <(tee -a ${IN}) > >(tee -a ${OUT})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue