Skip to content

Instantly share code, notes, and snippets.

@playpauseandstop
Last active July 9, 2016 09:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save playpauseandstop/b8517a69d3558f3bce4d2851d2bc4a50 to your computer and use it in GitHub Desktop.
Save playpauseandstop/b8517a69d3558f3bce4d2851d2bc4a50 to your computer and use it in GitHub Desktop.
Tiny wrapper around pip-check cmd, to run it inside venv Python first
#!/bin/bash
#
# Tiny shell script to run ``pip-check`` cmd inside of venv or fallback to
# global ``pip-check`` after.
#
# `pip-check <https://github.com/bartTC/pip-check/>`_ is a tool for checking
# outdated versions installed in your Python virtual environment or global
# site packages.
#
# Usage
# =====
#
# ::
#
# $ cd /path/to/project-with-env
# $ env-pip-check # will run env/bin/pip-check
# $ cd /path/to/project-with-tox
# $ env-pip-check # will run each available .tox/<toxenv>/bin/pip-check
# $ cd /path/to/all/projects
# $ env-pip-check # will run pip-check
#
found=`find . \( -d 3 -a -path *bin/pip-check -o -d 4 -a -path *tox/*/bin/pip-check \)`
for pip_check in $found; do
echo "$ ${pip_check}"
$pip_check
done
if [ -z "$found" ]; then
echo "Fallback to global pip-check"
pip-check
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment