summarylogtreecommitdiffstats
path: root/.pre-commit
diff options
context:
space:
mode:
authorAndrés Rodríguez2019-07-16 17:47:31 -0300
committerAndrés Rodríguez2019-07-16 17:47:31 -0300
commit9f2a918128a24c65c27c5ba84bd3d3398acdd682 (patch)
treeebb5b393f843372a1bf8a9a51f1b3c33e616412b /.pre-commit
parentb65ed54a90bda45248f4ea242b88345b818d5c4a (diff)
downloadaur-9f2a918128a24c65c27c5ba84bd3d3398acdd682.tar.gz
Update to version v0.66.100
Diffstat (limited to '.pre-commit')
-rwxr-xr-x.pre-commit13
1 files changed, 13 insertions, 0 deletions
diff --git a/.pre-commit b/.pre-commit
new file mode 100755
index 000000000000..3b532023a662
--- /dev/null
+++ b/.pre-commit
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+# fix environment of githooks
+unset GIT_DIR
+# if PKGBUILD has been altered, update .SRCINFO
+for path in $(git diff --name-only --cached --diff-filter=AM); do
+ if [[ "${path}" =~ .*PKGBUILD$ ]]; then
+ echo -e "\e[01;32m *** Generating and adding .SRCINFO for ${path} ***\e[00m"
+ (makepkg --printsrcinfo > "${PWD}"/.SRCINFO) || exit 1
+ git update-index
+ git add "${PWD}"/.SRCINFO
+ fi
+done