20 lines
464 B
INI
20 lines
464 B
INI
# Automatically adapt version in files.
|
|
|
|
function replace_python_package_version
|
|
{
|
|
file=$1
|
|
version=$2
|
|
|
|
# Watch out, this requires the version string to use double quotes:
|
|
cat $file | sed "s#^\\( *__version__ *= *\\)\"\\([0-9.-]\\{1,\\}\\)\"#\1\"$version\"#g" >$file.tmp
|
|
cat $file.tmp >$file
|
|
rm -f $file.tmp
|
|
git add $file
|
|
}
|
|
|
|
function new_version_hook
|
|
{
|
|
version=$1
|
|
replace_python_package_version zeekclient/__init__.py $version
|
|
}
|