From b1168ac6fc55ae4b415ea43f5b6403bdd769a29e Mon Sep 17 00:00:00 2001 From: TheK4n Date: Mon, 3 Oct 2022 22:57:00 +0300 Subject: [PATCH] git hooks for PKGBUILD --- Makefile | 1 + sub/git/gitconfig | 1 + sub/git/hooks/pre-commit | 7 +++++++ 3 files changed, 9 insertions(+) create mode 100755 sub/git/hooks/pre-commit diff --git a/Makefile b/Makefile index cbe933f..0ea8056 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,7 @@ ssh: git: ln -s $(PWD)/sub/git/gitconfig ~/.gitconfig ln -s $(PWD)/sub/git/gitignore ~/.gitignore + ln -s $(PWD)/sub/git/hooks ~/.githooks ranger: echo "sudo pacman -S highlight ttf-joypixels noto-fonts-emoji ueberzug poppler" diff --git a/sub/git/gitconfig b/sub/git/gitconfig index eb92548..ecfcda7 100644 --- a/sub/git/gitconfig +++ b/sub/git/gitconfig @@ -2,6 +2,7 @@ excludesfile = ~/.gitignore editor = nvim fileMode = false + hooksPath = /home/kan/.githooks [init] defaultBranch = master diff --git a/sub/git/hooks/pre-commit b/sub/git/hooks/pre-commit new file mode 100755 index 0000000..abb470d --- /dev/null +++ b/sub/git/hooks/pre-commit @@ -0,0 +1,7 @@ +#!/bin/sh +if [ -e PKGBUILD ] +then + makepkg --printsrcinfo > .SRCINFO + git add .SRCINFO + exit +fi