feat(tools): cleanup scripts and Makefile

This commit is contained in:
2026-02-22 20:33:04 +01:00
parent 85f53eff31
commit 5957ac4789
7 changed files with 166 additions and 152 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
# get_version.sh - Extract version from PostgreSQL extension control file
# Usage: ./get_version.sh [control_file]
set -e # Exit immediately if a command exits with a non-zero status
CONTROL_FILE="${1:-pg_morbac.control}"
if [ ! -f "$CONTROL_FILE" ]; then
echo "Error: control file not found: $CONTROL_FILE" >&2
exit 1
fi
VERSION=$(grep "default_version" "$CONTROL_FILE" | sed "s/default_version = '\(.*\)'/\1/")
if [ -z "$VERSION" ]; then
echo "Error: could not extract version from $CONTROL_FILE" >&2
exit 1
fi
echo "$VERSION"