mirror of
https://github.com/Zeal-Operating-System/ZealOS.git
synced 2024-12-26 07:20:32 +00:00
06a79a1a06
This patch adds a pre-commit hook specifically for *NIX systems to remove the cursor byte from all files under `src/`. The reason why I chose python is because it is assumed that most *NIX systems already come with it pre-installed. Signed-off-by: xSlendiX <slendi@socopon.com>
25 lines
469 B
Bash
Executable file
25 lines
469 B
Bash
Executable file
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
|
|
cd "${script_path}/.." || exit 1
|
|
pwd | grep -q '.git' && cd ..
|
|
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
NC='\033[0m' # No Color
|
|
|
|
FAILURES=0
|
|
|
|
set +e
|
|
|
|
echo "Running meta/check_code.sh"
|
|
if time meta/check_code.sh "$@" && git diff --exit-code; then
|
|
echo -e "[${GREEN}GOOD${NC}]: meta/check_code.sh"
|
|
else
|
|
echo -e "[${RED}FAIL${NC}]: meta/check_code.sh"
|
|
((FAILURES+=1))
|
|
fi
|
|
|
|
exit "${FAILURES}"
|