7e3a65490c21

Wrap pip.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 30 Sep 2009 07:01:51 -0400
parents 5c88585a0489
children d2e9d6c0f331
branches/tags (none)
files .bashrc

Changes

--- a/.bashrc	Wed Sep 30 06:01:08 2009 -0400
+++ b/.bashrc	Wed Sep 30 07:01:51 2009 -0400
@@ -41,6 +41,16 @@
 source ~/lib/hg/bash_completion
 source ~/lib/virtualenvwrapper_bashrc
 
+# Wrap pip to prevent stupid mistakes ----------------------------------------
+export PIP_BIN="`which pip`"
+alias pip-sys="$PIP_BIN"
+pip() {
+    if [ -n "$VIRTUAL_ENV" ]
+    then $PIP_BIN -E "$VIRTUAL_ENV" "$@"
+    else echo "Not currently in a venv -- use pip-sys to work system-wide."
+    fi
+}
+
 # Task stuff -----------------------------------------------------------------
 alias t='~/src/t/t.py --task-dir="~/tasks"'
 alias m='~/src/t/t.py --task-dir="~/tasks" --list=music'