commit e38ccaa8953178d06ef3c3a3c627ebd5c6a57eff parent a4084261ad09c713b6f6c837da31f9ff59053567 Author: Alex Balgavy <a.balgavy@gmail.com> Date: Mon, 10 Dec 2018 13:44:58 +0100 Worked virtualenv into pip update Former-commit-id: 1e31d533cae425ef696c561d4fb9841f8bf2b795 Diffstat:
M | bin/updatemaster | | | 41 | ++++++++++++++++++++++++----------------- |
1 file changed, 24 insertions(+), 17 deletions(-)
diff --git a/bin/updatemaster b/bin/updatemaster @@ -245,29 +245,36 @@ else fi echo -### PIP3 ### -echo_progress "PIP3 update/upgrade." -if command -v pip3 list &> /dev/null; then - pip3 list --outdated | cut -d ' ' -f1 | xargs -n1 pip3 install -U - notify "Pip3 Update Finished" "See Terminal for info." -else - echo_err "Cannot upgrade pip3 packages. Please do so manually." -fi -echo - -### PIP ### echo_progress "PIP update/upgrade." -if command -v pip list &> /dev/null; then - if pip freeze; then +if [ -f /usr/local/bin/virtualenvwrapper.sh ]; then + source /usr/local/bin/virtualenvwrapper.sh + echo "Working with virtualenv" + names=($(workon)) + for pip_env in ${names[@]}; do + workon "$pip_env" + pip3 list --outdated | cut -d ' ' -f1 | xargs -n1 pip3 install -U pip freeze — local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -U + deactivate + done +else + if command -v pip3 list &> /dev/null; then + pip3 list --outdated | cut -d ' ' -f1 | xargs -n1 pip3 install -U + notify "Pip3 Update Finished" "See Terminal for info." + else + echo_err "Cannot upgrade pip3 packages. Please do so manually." + fi + + if command -v pip list &> /dev/null; then + if pip freeze; then + pip freeze — local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -U + else + echo_err "Cannot upgrade pip packages. Please do so manually." + fi + notify "Pip Update Finished" "See Terminal for info." else echo_err "Cannot upgrade pip packages. Please do so manually." fi - notify "Pip Update Finished" "See Terminal for info." -else - echo_err "Cannot upgrade pip packages. Please do so manually." fi -echo ### SUDO PIP ### echo_progress "Global pip."