From 77e10ed757d0c6f9643950064d4db90a91c8c055 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Mon, 29 Oct 2018 09:52:26 -0700 Subject: [PATCH] Add utility to figure the current crate version --- ci/crate-version.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 ci/crate-version.sh diff --git a/ci/crate-version.sh b/ci/crate-version.sh new file mode 100755 index 000000000..5032088d3 --- /dev/null +++ b/ci/crate-version.sh @@ -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