Created
April 9, 2012 09:30
-
-
Save koba-ninkigumi/2342501 to your computer and use it in GitHub Desktop.
Install Python Fabric
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 | |
#: <<'#__COMMENT_OUT__' | |
if [ `uname -v | grep 'Ubuntu' | wc -c` != 0 ] ; then | |
sudo aptitude -y update | |
sudo aptitude -y upgrade | |
if ! which git ; then | |
sudo aptitude install -y build-essential git curl zlib1g-dev | |
fi | |
fi | |
source $HOME/.pythonbrewrc | |
if ! which pythonbrew ; then | |
if [ ! -d $HOME/git ]; then | |
mkdir $HOME/git | |
fi | |
if [ ! -d $HOME/git/pythonbrew ]; then | |
cd $HOME/git | |
git clone https://github.com/utahta/pythonbrew | |
fi | |
cd $HOME/git/pythonbrew | |
chmod +x pythonbrew-install | |
./pythonbrew-install | |
fi | |
if [ ! -d $HOME/.dotfiles ]; then | |
mkdir $HOME/.dotfiles | |
fi | |
if [ ! -f $HOME/.dotfiles/.pythonbrewrc ]; then | |
cp $HOME/git/pythonbrew/pythonbrew/etc/bashrc $HOME/.dotfiles/.pythonbrewrc | |
fi | |
if [ ! -f $HOME/.pythonbrewrc ]; then | |
ln -s $HOME/.dotfiles/.pythonbrewrc $HOME/.pythonbrewrc | |
fi | |
if [ `uname -v | grep 'Darwin' | wc -c` != 0 ] ; then | |
if ! grep -q '^source \$HOME/\.bashrc' $HOME/.profile ; then | |
echo 'source $HOME/.bashrc' >> $HOME/.profile | |
fi | |
fi | |
if ! grep -q '^source \$HOME/\.pythonbrewrc' $HOME/.bashrc ; then | |
echo 'source $HOME/.pythonbrewrc' >> $HOME/.bashrc | |
fi | |
source $HOME/.pythonbrewrc | |
if [ ! -d $HOME/.pythonbrew/pythons/Python-2.7.3 ] ; then | |
pythonbrew install --force 2.7.3 | |
pythonbrew symlink | |
pythonbrew switch 2.7.3 | |
pythonbrew py pip install Fabric | |
pythonbrew venv create dev | |
pythonbrew venv use dev | |
fi | |
# venvの仮想環境を消すときは | |
# pythonbrew venv delete | |
# pythonbrewの仮想環境をoffにするときは | |
# pythonbrew off | |
##__COMMENT_OUT__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment