update version.sh script to affect doc contents

This commit is contained in:
Niko Matsakis 2017-04-07 05:52:18 -04:00
parent 94dda2e852
commit 30570e4cd3
2 changed files with 22 additions and 1 deletions

View File

@ -9,6 +9,9 @@ path = "../../../lalrpop"
[dependencies]
docopt = "0.7"
lalrpop-util = { version = "0.12.5", path = "../../../lalrpop-util" }
rustc-serialize = "0.3"
regex = "0.2.1"
[dependencies.lalrpop-util]
version = "0.12.5"
path = "../../../lalrpop-util"

View File

@ -8,5 +8,23 @@ if [ "$1" == "" ]; then
exit 1
fi
VERSION=$(
ls lalrpop*/Cargo.toml | \
xargs grep "# LALRPOP$" | \
perl -p -e 's/.*version = "([0-9.]+)" # LALRPOP$/$1/' |
sort |
uniq)
if [ $(echo $VERSION | wc -w) != 1 ]; then
echo "Error: inconsistent versions detected across Cargo.toml files!"
echo "$VERSION"
exit 1
fi
echo "Found consistent version $VERSION"
perl -p -i -e 's/version *= *"[0-9.]+" # LALRPOP$/version = "'$1'" # LALRPOP/' \
$(ls lalrpop*/Cargo.toml)
perl -p -i -e 's/version *= *"'$VERSION'"$/version = "'$1'"/' \
$(find doc -name Cargo.toml)