#!/bin/sh set -eu if [ $# -gt 0 ]; then version=$1 else script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) root_dir=$(dirname -- "$script_dir") version=$(python3 "$root_dir/scripts/check-version.py" --print-version) fi case "$version" in ''|*[!0-9.]*) printf 'Error: version must be numeric X.Y.Z\n' >&2 exit 1 ;; esac if ! printf '%s\n' "$version" | grep -Eq '^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$'; then printf 'Error: version must be numeric X.Y.Z\n' >&2 exit 1 fi cat <