mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00

- Useful to validate that all the expected arguments were passed with correct escaping. - Update test/template.t with one use-case for 'args'
18 lines
546 B
Bash
18 lines
546 B
Bash
#!/usr/bin/env bash
|
|
|
|
SELF=$(basename $0)
|
|
ORIGINALHOOK="$(dirname $0)/original_${SELF}"
|
|
IN="${ORIGINALHOOK}.log.in"
|
|
OUT="${ORIGINALHOOK}.log.out"
|
|
|
|
# Let it know that we were executed
|
|
echo "% Called at $(python -c 'import time; print(time.time())') with '$@'" >> ${IN}
|
|
|
|
# Log what arrives via stdin to ${IN} and what comes via stdout to ${OUT}
|
|
$ORIGINALHOOK "$@" < <(tee -a ${IN}) > >(tee -a ${OUT})
|
|
# More on the < <() syntax at: http://tldp.org/LDP/abs/html/process-sub.html
|
|
|
|
EXITCODE=$?
|
|
echo "! Exit code: ${EXITCODE}" >> ${OUT}
|
|
|
|
exit $EXITCODE
|