Files
fuzzforge_ai/scripts/pyproject-version.sh
abel 712b91ccb3 feat(makefile): add module build targets and helper scripts
Split module image build into build-modules-sdk and
build-modules-images; build-modules
now depends on both. Factor container engine detection and version
parsing into
scripts/container-env.sh and scripts/pyproject-version.sh respectively.
Add Makefile
variables for SDK/module paths and image naming, update help output, and
simplify
clean target to remove common caches and .pyc files.
2026-03-10 12:50:16 +01:00

13 lines
441 B
Bash
Executable File

#!/usr/bin/env bash
# Extract the version from a pyproject.toml file.
# Usage: pyproject-version.sh <path/to/pyproject.toml> [default]
# Prints the version string, or the default (0.0.1) if not found.
PYPROJECT="${1:?Usage: pyproject-version.sh <pyproject.toml> [default]}"
DEFAULT="${2:-0.0.1}"
version=$(grep -m1 '^version\s*=' "${PYPROJECT}" 2>/dev/null \
| sed 's/^version\s*=\s*//;s/"//g;s/\s*$//')
echo "${version:-${DEFAULT}}"