Created
December 30, 2018 15:29
-
-
Save m1cr0man/634a6d4910e4800de1d05854bd8bdacf to your computer and use it in GitHub Desktop.
Script to link binaries from virtualenv to a dir in PATH
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 | |
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