From 6f1f595e3ecd7c11cb096995bd32361ef624f7ac Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Tue, 7 Jan 2020 19:59:49 +0000 Subject: [PATCH] dev tools: Print the test data to stdout for convenience. --- tests/generate.zsh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/generate.zsh b/tests/generate.zsh index 64a1ede..811abae 100755 --- a/tests/generate.zsh +++ b/tests/generate.zsh @@ -55,15 +55,15 @@ _zsh_highlight_add_highlight() # Copyright block year="`LC_ALL=C date +%Y`" -if ! read -q "?Set copyright year to $year? "; then +if ! { read -q "?Set copyright year to $year? " } always { echo "" }; then year="YYYY" fi -exec >$fname -<$0 sed -n -e '1,/^$/p' | sed -e "s/2[0-9][0-9][0-9]/${year}/" +<$0 sed -n -e '1,/^$/p' | sed -e "s/2[0-9][0-9][0-9]/${year}/" > $fname # Assumes stdout is line-buffered git add -- $fname # Buffer +exec > >(tee $fname) print -n 'BUFFER=' if [[ $buffer != (#s)[$'\t -~']#(#e) ]]; then print -r -- ${(qqqq)buffer}