Created
November 6, 2012 07:35
-
-
Save jiskanulo/4023267 to your computer and use it in GitHub Desktop.
Homebrewでインストールしたphp53とphp54を切り替える
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
#!/bin/bash | |
if [ ! -x `which brew` ]; then | |
echo "Homebrew does not installed." | |
exit 1 | |
fi | |
php_path=`which php` | |
php_real_path=`stat -F $php_path` | |
if [ -n "`echo $php_real_path | grep 'Cellar/php53'`" ]; then | |
echo 'now switching php53 -> php54...' | |
brew unlink php53 | |
brew link php54 | |
elif [ -n "`echo $php_real_path | grep 'Cellar/php54'`" ]; then | |
echo 'now switching php54 -> php53...' | |
brew unlink php54 | |
brew link php53 | |
else | |
echo 'can not switch php' | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment