php-ml/bin/handle_brew_pkg.sh
Arkadiusz Kondas a11e3f69c3
Add support for coveralls.io (#153)
* Add support for coveralls.io

* Generate coverage report only on php 7.2 build

* Fix osx travis build and move tools to bin dir

* Update php version badge

* Fix travis conditional statement

* Fix travis conditional statement

* 🤦 fix bin path
2017-11-15 11:08:51 +01:00

31 lines
663 B
Bash

#!/usr/bin/env bash
if [[ "$#" -eq 1 ]]; then
echo "Handling \"$1\" brew package..."
else
echo "Brew failed - invalid $0 call"
exit 1;
fi
if [[ $(brew ls --versions "$1") ]]; then
if brew outdated "$1"; then
echo "Package upgrade is not required, skipping"
else
echo "Updating package...";
brew upgrade "$1"
if [ $? -ne 0 ]; then
echo "Upgrade failed"
exit 1
fi
fi
else
echo "Package not available - installing..."
brew install "$1"
if [ $? -ne 0 ]; then
echo "Install failed"
exit 1
fi
fi
echo "Linking installed package..."
brew link "$1"