From d727ce7e7ac94ee7e6fec8d434f65b8fa174ac85 Mon Sep 17 00:00:00 2001 From: thek4n Date: Wed, 10 Jan 2024 20:27:36 +0300 Subject: [PATCH] githook for arch PKGBUILD --- home/user/.config/git/hooks/pre-commit | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/home/user/.config/git/hooks/pre-commit b/home/user/.config/git/hooks/pre-commit index f509054..cbecb6e 100755 --- a/home/user/.config/git/hooks/pre-commit +++ b/home/user/.config/git/hooks/pre-commit @@ -1,6 +1,11 @@ #!/bin/sh set -e if command -v makepkg >/dev/null && [ -e PKGBUILD ]; then + if [ -e VERSION ]; then + sed -i "s/pkgver=.\+/pkgver=$(cat VERSION)/" PKGBUILD + git add PKGBUILD + fi + makepkg --printsrcinfo > .SRCINFO git add .SRCINFO exit