diff --git a/dotfiles/zsh/.env b/dotfiles/zsh/.env index abdbe8b..6b549f5 100644 --- a/dotfiles/zsh/.env +++ b/dotfiles/zsh/.env @@ -56,12 +56,18 @@ if [ -z "$VIRTUALENVWRAPPER_PYTHON_VERSION" ]; then export VIRTUALENVWRAPPER_PYTHON_VERSION=3.10 fi +if [ -z "$MAIN_PYTHON_VERSION" ]; then + export MAIN_PYTHON_VERSION=3.10 +fi + if [[ $(uname -s) == 'Darwin' ]]; then for py_version in {"3.6","3.8","3.10"}; do prepend_path "/Library/Frameworks/Python.framework/Versions/${py_version}/bin" done prepend_path "/Users/$USER/Library/Python/3.10/bin" + _gpython="/Library/Frameworks/Python.framework/Versions/${MAIN_PYTHON_VERSION}/bin/python" + TMP=/Library/Frameworks/Python.framework/Versions/${VIRTUALENVWRAPPER_PYTHON_VERSION}/bin/python${VIRTUALENVWRAPPER_PYTHON_VERSION} if [ -f $TMP ]; then export VIRTUALENVWRAPPER_PYTHON=$TMP @@ -73,6 +79,10 @@ if [[ $(uname -s) == "Linux" ]]; then if [ -f /usr/local/bin/python${VIRTUALENVWRAPPER_PYTHON_VERSION} ]; then export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python${VIRTUALENVWRAPPER_PYTHON_VERSION} fi + + if [ -f /usr/local/bin/python${MAIN_PYTHON_VERSION} ]; then + _gpython="/usr/local/bin/python${MAIN_PYTHON_VERSION}" + fi fi if [[ $(command_exists virtualenvwrapper.sh) == true ]]; then @@ -80,6 +90,14 @@ if [[ $(command_exists virtualenvwrapper.sh) == true ]]; then source $(which virtualenvwrapper.sh) fi +gpython() { + $_gpython $@ +} + +gpip() { + $_gpython -m pip $@ +} + # Go go-add-env-and-path() { mkdir -p "$GOROOT/bin" "$GOPATH/bin"