Created
December 23, 2018 18:21
-
-
Save torbjo/60934492297153ca66cef48190d2f2b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
pkglst=$(pip list --user --outdated --format=freeze | cut -d= -f1) | |
if [ "$pkglst" = "" ]; then | |
echo "All pip packages is up to date. Nothing to do." | |
exit | |
fi | |
echo -ne "OUTDATED PIP PACKAGES:\n " | |
echo $pkglst | sed 's/ /\n /g' | |
echo -n "Upgrade these packages? [y/N] " | |
read -n1 answer | |
[ "$answer" = "" ] && exit # \n | |
echo "" | |
if [ $answer = Y -o $answer = y ]; then | |
echo $pkglst | xargs pip install --upgrade --user | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment