Skip to content

Instantly share code, notes, and snippets.

@koba-ninkigumi
Created April 9, 2012 09:30
Show Gist options
  • Save koba-ninkigumi/2342501 to your computer and use it in GitHub Desktop.
Save koba-ninkigumi/2342501 to your computer and use it in GitHub Desktop.
Install Python Fabric
#!/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