fix using pyenv

master
Kebler Network System Administrator 2021-07-05 09:37:32 -07:00
parent b1e1065e4c
commit b5901d1d6f
3 changed files with 19 additions and 17 deletions

View File

@ -44,7 +44,7 @@ alias npma="npm-add-dependencies"
# alias npmpub="npm publish --access public"
alias npmlrepub="npm publish --registry http://localhost:4873 --force --access restricted"
alias npmlpub="npm publish --registry http://localhost:4873 --access restricted"
alias npmkrepub="npm version patch && npm publish --registry https://npm.kebler.net --access restricted"
alias npmkrepub="npm publish --registry https://npm.kebler.net --force --access restricted"
alias npmkpub="npm publish --registry https://npm.kebler.net --access restricted"
alias npmpatch="npm version patch"
alias npmmajor="npm version major"

View File

@ -1,4 +1,14 @@
#!/bin/bash
use_pyenv () {
if command -v pyenv >/dev/null 2>&1; then
export PYENV_ROOT="/opt/python/pyenv"
export PYENV_VERSION=${PYENV_VERSION:-3.8.7}
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
}
# TODO make alias generating function for versions of python
alias python3x="sudo -H python3.8 -m"
alias spip="sudo -H python3.8 -m pip"
@ -14,24 +24,15 @@ alias pipi="pipx install"
alias pipl="pipx list"
alias piplv="pipx list --verbose"
if command -v pyenv >/dev/null 2>&1; then
# pyenv environment
path_append "/opt/python/bin"
# eval "$(pyenv init -)"
# eval "$(pyenv virtualenv-init -)"
export PYENV_ROOT="/opt/python/pyenv"
export PYENV_VERSION=3.8.7
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
if command -v pipx >/dev/null 2>&1; then
path_append "/opt/python/apps/bin"
export PIPX_HOME=/opt/python/apps
export PIPX_BIN_DIR=$PIPX_HOME/bin
fi
[[ $USE_PYENV ]] && use_pyenv
spipua () {
module_load confirm
@ -44,3 +45,4 @@ echo "$List"
confirm "ATTENTION: upgrade all these packages at once??" || return 0
echo "$List" | cut -d' ' -f1 | xargs -n1 sudo -H python$Ver -m pip install -U
}