15 lines
477 B
Fish
15 lines
477 B
Fish
function pip_upgrade --description "Upgrade python packages"
|
|
set --local py_pkgs_outdated (python3 -m pip list --outdated | awk 'NR > 2 {print $1}')
|
|
|
|
if test (count $py_pkgs_outdated) -eq 0
|
|
echo "All packages up-to-date."
|
|
else
|
|
echo "Outdated packages: $py_pkgs_outdated"
|
|
if confirm "Continue with upgrade?"
|
|
for py_pkg in $py_pkgs_outdated
|
|
python3 -m pip install -U $py_pkg
|
|
end
|
|
end
|
|
end
|
|
end
|