mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-18 08:01:10 +02:00
[git-tools] use mktemp in pre-commit (thanks nn-)
This commit is contained in:
@ -28,13 +28,12 @@ IFS=" "
|
||||
for file in $(git diff --cached --name-status $against | grep -v -E '^D' | cut -f2 | grep -E '\.php$')
|
||||
do
|
||||
# store lint result in a temp file
|
||||
tempfile="/tmp/$(basename $0).$$.tmp"
|
||||
tempfile=$(mktemp -t "$(basename $0).XXXXXX")
|
||||
if ! php -l "$file" >/dev/null 2>"$tempfile"
|
||||
then
|
||||
error=1
|
||||
cat "$tempfile"
|
||||
fi
|
||||
rm -f "$tempfile"
|
||||
done
|
||||
unset IFS
|
||||
|
||||
|
Reference in New Issue
Block a user