add script to pre commit hooks for checking file permissions (#2322)

This commit is contained in:
Aviral Goel
2025-06-17 10:07:08 -04:00
committed by GitHub
parent 3c4cdfac4f
commit 3af66e99ab
2 changed files with 14 additions and 0 deletions

8
script/remove_exec_bit.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
for file in $(git diff --cached --name-only --diff-filter=ACM | grep -E '\.(cpp|hpp|txt|inc)$'); do
if [ -x "$file" ]; then
chmod -x "$file"
echo "[remove-exec-bit] Removed executable bit from $file" >&2
fi
done