Address issues reported by pre-commit for pip plugin.

pull/1718/head
Nariyasu Heseri 2020-12-05 01:36:51 +09:00
parent 04f78462a5
commit b2ebdf8515
1 changed files with 16 additions and 16 deletions

View File

@ -2,23 +2,23 @@ cite about-plugin
about-plugin 'pip upgrade/uninstall all packages'
pip-upgrade-all() {
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
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() {
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
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
}