krata/scripts/dist/version.sh
2024-03-07 09:04:05 +00:00

16 lines
349 B
Bash
Executable File

#!/bin/sh
set -e
# shellcheck source=common.sh
. "$(dirname "${0}")/common.sh"
cd "${KRATA_DIR}"
KRATA_VERSION="$(grep -A1 -F '[workspace.package]' Cargo.toml | grep 'version' | awk '{print $3}' | sed 's/"//g')"
if [ -z "${KRATA_VERSION}" ]
then
echo "ERROR: failed to determine krata version" > /dev/stderr
exit 1
fi
echo "${KRATA_VERSION}"