Last active
August 29, 2015 14:17
-
-
Save danmatthews/5533460b3287ba0995f2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#! /usr/bin/env bash | |
# Change to your home dir. | |
cd ~/ | |
if [ -a /usr/local/bin/composer ]; then | |
echo "You already have composer" | |
composerpath='composer' | |
else | |
# Get the composer.phar file. | |
curl -S http://getcomposer.org/installer | php | |
if [[ "$PATH" == *"/usr/local/bin"* ]]; then | |
# Move composer to a global folder in your $PATH; | |
sudo mv composer.phar /usr/local/bin/composer | |
composerpath='composer' | |
else | |
echo "Could not find global directory in path, using the local version to get stuff"; | |
composerpath='php ~/composer.phar' | |
fi | |
fi | |
# Install testing components globally - this means you can run them from anywhere on your computer. | |
$composerpath global require behat/behat | |
$composerpath global require behat/mink | |
$composerpath global require behat/mink-goutte-driver | |
$composerpath global require behat/mink-selenium2-driver | |
$composerpath global require squizlabs/php_codesniffer | |
$composerpath global require squizlabs/mink-extension | |
$composerpath global require phpunit/phpunit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Once you've done this, you need to add
~/.composer/vendor/bin
to your$PATH
. You can do that by adding:to
~/.bash_profile
or~/.bashrc