Debian Codegraph @

scripts/get-pyproject-uv.version.sh

raw
1 #!/usr/bin/env bash
2
3 # Find the absolute path of the directory where this script resides
4 SCRIPT_DIR=$(cd -- "$(dirname -- "$0")" &>/dev/null && pwd)
5
6 # Go up one level to reach the repository root directory
7 REPO_ROOT=$(dirname "$SCRIPT_DIR")
8
9 # Isolate the [tool.uv-version] block and extract the clean version string
10 sed -n '/\[tool.uv-version\]/,/version =/p' "$REPO_ROOT/pyproject.toml" | grep 'version =' | sed -E 's/.*version = "([^"]+)".*/\1/' | tr -d '\r' | xargs