mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[git-tools] use mktemp in pre-commit (thanks nn-)
This commit is contained in:
parent
3dd9040cc1
commit
6df10358aa
1 changed files with 1 additions and 2 deletions
|
@ -28,13 +28,12 @@ IFS=" "
|
||||||
for file in $(git diff --cached --name-status $against | grep -v -E '^D' | cut -f2 | grep -E '\.php$')
|
for file in $(git diff --cached --name-status $against | grep -v -E '^D' | cut -f2 | grep -E '\.php$')
|
||||||
do
|
do
|
||||||
# store lint result in a temp file
|
# 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"
|
if ! php -l "$file" >/dev/null 2>"$tempfile"
|
||||||
then
|
then
|
||||||
error=1
|
error=1
|
||||||
cat "$tempfile"
|
cat "$tempfile"
|
||||||
fi
|
fi
|
||||||
rm -f "$tempfile"
|
|
||||||
done
|
done
|
||||||
unset IFS
|
unset IFS
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue