Permalink
Browse files

Improve error detection on PECL extension installation.

  • Loading branch information...
1 parent 781ac47 commit b5f248767c3ffab9b05ecd762d546dbfa5849cd6 @loicfrering loicfrering committed Mar 5, 2013
Showing with 6 additions and 2 deletions.
  1. +6 −2 ci_environment/php/providers/pecl.rb
@@ -32,7 +32,10 @@
fi
pecl info #{extension}
- if [ $? != 0 ]; then
+ return=$?
+ if [ $return = 0 ]; then
+ echo "Extension #{extension} was already installed for PHP #{php_version}."
+ elif [ $return = 1 ]; then
result=$(pecl install #{extension} | tail -1)
if [[ "$result" =~ ^ERROR: ]]; then
echo "There was an error installing extension #{extension} for PHP #{php_version}:"
@@ -41,7 +44,8 @@
fi
echo "Extension #{extension} successfully installed for PHP #{php_version}."
else
- echo "Extension #{extension} was already installed for PHP #{php_version}."
+ echo "There was an error installing extension #{extension} for PHP #{php_version}."
+ exit 1
fi
EOF
end

0 comments on commit b5f2487

Please sign in to comment.