coreboot-kgpe-d16/util/gitconfig/pre-commit
Martin Roth 0ad5fbd48d util: Update all shebangs to use /usr/bin/env
Instead of hardcoding paths to the executables, use the version in the
path.  This allows the scripts to work on more systems, and allows the
binary version to be changed more easily if needed.

Signed-off-by: Martin Roth <martin@coreboot.org>
Change-Id: Ifcc56aa21092cd3866eacb6a02d198110ec6051d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48904
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2021-01-25 08:57:40 +00:00

16 lines
420 B
Bash
Executable file

#!/usr/bin/env sh
##
## SPDX-License-Identifier: GPL-2.0-only
set -e # -o errexit
set -u # -o nounset
%MAKE% check-style lint-stable
PATCHDIFF=$(git diff --cached --src-prefix=a/ --dst-prefix=b/)
if printf "%s\n" "$PATCHDIFF" | grep -q "@@"; then
echo
echo "Running checkpatch"
printf "%s\n" "$PATCHDIFF" | util/lint/lint-007-checkpatch diff \
|| (echo "Please consider fixing these issues." ;sleep 5) ; true
fi