Add utility to figure the current crate version

This commit is contained in:
Michael Vines 2018-10-29 09:52:26 -07:00
parent ebcb9a2103
commit 77e10ed757
1 changed files with 16 additions and 0 deletions

16
ci/crate-version.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash -e
#
# Outputs the current crate version
#
cd "$(dirname "$0")"/..
while read -r name equals value _; do
if [[ $name = version && $equals = = ]]; then
echo "${value//\"/}"
exit 0
fi
done < <(cat Cargo.toml)
echo Unable to locate version in Cargo.toml 1>&2
exit 1