Skip to content

Instantly share code, notes, and snippets.

@m1cr0man
Created December 30, 2018 15:29
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 m1cr0man/634a6d4910e4800de1d05854bd8bdacf to your computer and use it in GitHub Desktop.
Save m1cr0man/634a6d4910e4800de1d05854bd8bdacf to your computer and use it in GitHub Desktop.
Script to link binaries from virtualenv to a dir in PATH
#!/bin/bash
IGNORED="
activate
activate.csh
activate.fish
activate_this.py
easy_install
easy_install-3.6
pip
pip3
pip3.6
python
python3
python3.6
python-config
wheel
"
source ~/.local/localpy-36/bin/activate
set -euo pipefail
pip $*
for f in ~/.local/localpy-36/bin/*; do
fname=$(basename $f)
if ! echo "$IGNORED" | grep $fname > /dev/null 2>&1 && ! [ -e ~/.local/bin/$fname ]; then
ln -s "$f" ~/.local/bin/$fname
fi
done
deactivate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment