dev: bump to 0.1.72-dev – Autoplay-Setting, Moflix Hoster-Dialog, Update-Hinweis im Hauptmenue
This commit is contained in:
27
scripts/hooks/pre-commit
Executable file
27
scripts/hooks/pre-commit
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/bin/bash
|
||||
# pre-commit: Patch-Version in addon.xml automatisch hochzählen (nur dev-Branch)
|
||||
|
||||
branch=$(git symbolic-ref --short HEAD 2>/dev/null)
|
||||
[[ "$branch" != "dev" ]] && exit 0
|
||||
|
||||
root=$(git rev-parse --show-toplevel)
|
||||
cd "$root"
|
||||
|
||||
# Version aus addon.xml lesen
|
||||
current=$(grep -oP 'version="\K[0-9]+\.[0-9]+\.[0-9]+[^"]*' addon/addon.xml | head -1)
|
||||
if [[ -z "$current" ]]; then
|
||||
echo "[hook] Fehler: Version nicht gefunden in addon/addon.xml" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Patch-Nummer extrahieren und hochzählen
|
||||
IFS='.' read -r major minor patch_full <<< "$current"
|
||||
patch=$(echo "$patch_full" | grep -oP '^\d+')
|
||||
suffix=$(echo "$patch_full" | grep -oP '[^0-9].*' || true)
|
||||
new_version="${major}.${minor}.$((patch + 1))${suffix}"
|
||||
|
||||
# addon.xml aktualisieren
|
||||
sed -i "s/version=\"${current}\"/version=\"${new_version}\"/" addon/addon.xml
|
||||
git add addon/addon.xml
|
||||
|
||||
echo "[hook] Version: $current → $new_version"
|
||||
Reference in New Issue
Block a user