diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2012-04-03 23:06:50 -0400 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2012-04-03 23:06:50 -0400 |
commit | 786fcbf212caf4c201d9abba36fca3b8f58617a9 (patch) | |
tree | cf5ed5880d811a3d7ffcf668c8b0b06082623e34 /git-tools/hooks | |
parent | 57209a1e680da729cad0a1cd7e9462254edcd6cb (diff) | |
download | forums-786fcbf212caf4c201d9abba36fca3b8f58617a9.tar forums-786fcbf212caf4c201d9abba36fca3b8f58617a9.tar.gz forums-786fcbf212caf4c201d9abba36fca3b8f58617a9.tar.bz2 forums-786fcbf212caf4c201d9abba36fca3b8f58617a9.tar.xz forums-786fcbf212caf4c201d9abba36fca3b8f58617a9.zip |
[ticket/10760] Use echo -e only if echo understands -e.
/bin/echo on freebsd and dash's builtin echo do not understand -e,
therefore -e is printed with the other messages in such cases.
Test if echo understands -e, if not do not use it.
PHPBB3-10760
Diffstat (limited to 'git-tools/hooks')
-rwxr-xr-x | git-tools/hooks/pre-commit | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/git-tools/hooks/pre-commit b/git-tools/hooks/pre-commit index a8bb12e96e..0e230d3308 100755 --- a/git-tools/hooks/pre-commit +++ b/git-tools/hooks/pre-commit @@ -17,6 +17,13 @@ then PHP_BIN=php fi +if [ $(echo -e test) = test ] +then + echo_e="echo -e" +else + echo_e="echo" +fi + # necessary check for initial commit if git rev-parse --verify HEAD >/dev/null 2>&1 then @@ -78,7 +85,7 @@ unset IFS if [ $error -eq 1 ] then - echo -e "PHP Syntax check failed:"; - echo -e "$errors" | grep "^Parse error:" + echo "PHP Syntax check failed:" + $echo_e "$errors" | grep "^Parse error:" exit 1 fi |