Closed yantosca closed 10 months ago
This is a nice script that will help us to ensure consistent version numbering in these files!
sed -i -e "s/${1}/${2}/" "${3}"
I'm always scared when I have to use the dollar sign for a shell variable inside a regexp that treats dollar signs as the end of line. Usually this requires escape characters at the right places. Maybe this works here because
sed
is called without the-E
option? Anyway, I guess you have tested it and all is fine.
Yes, this works. I haven't come across any other issues with commands like these. But I'll also make sure this also works on MacOSX as well before I merge.
# X.Y.Z = GCClassic version number
Should this be
KPP version number
?
Oops, indeed! I stole this script from GEOS-Chem. :-). I'll fix it.
@RolfSander: In commit 9387531, I fixed the incorrect comment and have updated the sed command (which I've confirmed works on both Linux and Mac):
function replace() {
#========================================================================
# Replacement for `sed -i -e` that works on both MacOS and Linux
#
# 1st argument = regular expression
# 2nd argument = file to be edited
#========================================================================
regex="s/${1}/${2}/g"
file="${3}"
if [[ "x$(uname -s)" == "xDarwin" ]]; then
sed -i '' -e "${regex}" "${file}" # MacOS/Darwin
else
sed -i -e "${regex}" "${file}" # GNU/Linux
fi
}
This PR adds the
.release/changeVersionNumbers.sh
script, which changes version numbers in the following locations:CHANGELOG.md
src/gdata.h
docs/source/conf.py
NOTE: In
CHANGELOG.md
, the script will change any of the following:to