Merge 3256245580 into 501b1ab3b5
commit
9c7372dcb1
|
|
@ -34,3 +34,7 @@ completion/available/cargo.completion.bash
|
|||
completion/available/knife.completion.bash
|
||||
completion/available/pipx.completion.bash
|
||||
completion/available/rustup.completion.bash
|
||||
|
||||
# plugins
|
||||
#
|
||||
plugins/available/pip.plugin.bash
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
cite about-plugin
|
||||
about-plugin 'pip helper functions'
|
||||
|
||||
pip-upgrade-all() {
|
||||
about 'upgrades all system- and user-installed pip packages to user home'
|
||||
group 'pip'
|
||||
|
||||
local outdated_packages="$(pip list --outdated --format=freeze | grep -v '^\-e' | cut -d = -f 1)"
|
||||
if [ -z "$outdated_packages" ]; then
|
||||
echo "pip: everything is up to date."
|
||||
else
|
||||
for package in $outdated_packages; do
|
||||
pip install --user -U "$package"
|
||||
done
|
||||
fi
|
||||
}
|
||||
|
||||
pip-uninstall-all() {
|
||||
about 'uninstalls all user-installed pip packages'
|
||||
group 'pip'
|
||||
|
||||
local installed_packages="$(pip list --user --format=freeze | grep -v '^\-e' | cut -d = -f 1)"
|
||||
if [ -z "$installed_packages" ]; then
|
||||
echo "pip: nothing has been installed."
|
||||
else
|
||||
for package in $installed_packages; do
|
||||
pip uninstall -y "$package"
|
||||
done
|
||||
fi
|
||||
}
|
||||
Loading…
Reference in New Issue