mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
[plugins/pip] Add shortcut for upgrading pip outdated packages.
This commit is contained in:
parent
0532860c61
commit
2bdca4978f
1 changed files with 20 additions and 0 deletions
|
|
@ -76,3 +76,23 @@ zsh-pip-test-clean-packages() {
|
|||
echo "the djangopypi2 index is fine"
|
||||
fi
|
||||
}
|
||||
|
||||
zsh-pip-upgrade-installed-packages() {
|
||||
|
||||
outdated_packages=`pip list -o 2>/dev/null`
|
||||
|
||||
if [[ -n $outdated_packages ]] ; then
|
||||
echo "Outdated packages:"
|
||||
echo -e "$outdated_packages\n"
|
||||
|
||||
echo -e "Start upgrading...\n"
|
||||
echo $outdated_packages | awk {'print $1'} | xargs pip install -U
|
||||
echo -e "\nAll installed packages are up to date."
|
||||
else
|
||||
echo "No outdated packages."
|
||||
fi
|
||||
}
|
||||
|
||||
pip-upgrade() {
|
||||
zsh-pip-upgrade-installed-packages
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue