Last active
February 1, 2016 09:21
-
-
Save akerouanton/1b20c4d2aa11b3836de8 to your computer and use it in GitHub Desktop.
Bash macro preventing composer execution with xdebug enabled
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COMPOSER_PATH=`which composer` | |
composer() { | |
if ! php5query -s cli -m xdebug >/dev/null; then | |
$COMPOSER_PATH $@ | |
return | |
fi | |
# Re-enable xdebug even after a ctrl-c (SIGINT) | |
# and clear the signal handler | |
trap 'sudo php5enmod xdebug; trap - INT' INT | |
sudo php5dismod -s cli xdebug | |
$COMPOSER_PATH $@ | |
sudo php5enmod -s cli xdebug | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment