diff --git a/_pip.sh b/_pip.sh index d81f9e0..ffe9ef5 100755 --- a/_pip.sh +++ b/_pip.sh @@ -7,12 +7,18 @@ version=pip3 #user: "" or "--user" user="" +# No distract mode +no_distract=false #add module to do_not_update array -declare -a do_not_update=( "tornado") +declare -a do_not_update=( "tornado","urllib3") + +if [[ $1 == "nodistract" ]]; then + no_distract=true +fi if ! [ -x "$(command -v $version)" ]; then - echo "Error: $version is not installed." >&2 - exit 1 + echo "Error: $version is not installed." >&2 + exit 1 fi echo "" @@ -56,10 +62,10 @@ if [ -n "$upd" ]; then done <<< "$dependencies" fi - # si la m-à-j n'est pas dans le tableau do_not_update, on propose de l'installer + # If the update is not in the do_not_update array, we install it. FOUND=`echo ${do_not_update[*]} | grep "$i"` - if [ "${FOUND}" = "" ]; then + if [ "${FOUND}" = "" ] && [ "$no_distract" = false ]; then b=$(echo -e "Do you wanna run \033[1m$version install $user --upgrade "$i"\033[0m ? (y/n)") read -p "$b" choice @@ -70,6 +76,10 @@ if [ -n "$upd" ]; then esac echo "" + elif [ "${FOUND}" = "" ]; then + + echo $i | xargs $version install $user --upgrade + fi done