dev tools: Automate a recurring step: Set year correctly for new tests.
This commit is contained in:
parent
6f91850a01
commit
e15a09840e
@ -40,8 +40,10 @@ if (( $# != 3 )) || [[ $1 == -* ]]; then
|
|||||||
fi
|
fi
|
||||||
buffer=$1
|
buffer=$1
|
||||||
ZSH_HIGHLIGHT_HIGHLIGHTERS=( $2 )
|
ZSH_HIGHLIGHT_HIGHLIGHTERS=( $2 )
|
||||||
exec >${0:A:h:h}/highlighters/$2/test-data/$3.zsh
|
fname=${0:A:h:h}/highlighters/$2/test-data/$3.zsh
|
||||||
git add -N ${0:A:h:h}/highlighters/$2/test-data/$3.zsh
|
exec 3>&1
|
||||||
|
exec >$fname
|
||||||
|
git add -N $fname
|
||||||
|
|
||||||
# Load the main script.
|
# Load the main script.
|
||||||
. ${0:A:h:h}/zsh-syntax-highlighting.zsh
|
. ${0:A:h:h}/zsh-syntax-highlighting.zsh
|
||||||
@ -85,3 +87,10 @@ print 'expected_region_highlight=('
|
|||||||
done
|
done
|
||||||
}
|
}
|
||||||
print ')'
|
print ')'
|
||||||
|
|
||||||
|
exec >&3
|
||||||
|
year="`LC_ALL=C date +%Y`"
|
||||||
|
if read -q "?Set copyright year to $year? "; then
|
||||||
|
<$fname >$fname.t sed s/YYYY/$year/ &&
|
||||||
|
mv $fname.t $fname
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user