Last active
March 30, 2018 17:32
-
-
Save looselyrigorous/e80a8f05b1ecc726f297320524648e13 to your computer and use it in GitHub Desktop.
Script to update links to Homebrew installed python for pyenv
This file contains hidden or 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/sh | |
# Author: looselyrigorous <[email protected]> | |
# Run inside your pyenv versions folder. | |
# It usually is ~/.pyenv/versions | |
# Remove existing versions | |
for linked_ver in ./*-brew; do | |
if [ -L "$linked_ver" ]; then | |
unlink "$linked_ver" | |
fi | |
done | |
# Python 2 | |
for py2_ver in /usr/local/Cellar/python@2/*; do | |
ln -s "$py2_ver" "$(basename "$py2_ver")-brew" | |
done | |
# Python 3 | |
for py3_ver in /usr/local/Cellar/python3/*; do | |
ln -s "$py3_ver" "$(basename "$py3_ver")-brew" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment