_pip.sh
Ajout du mode no_distract
This commit is contained in:
16
_pip.sh
16
_pip.sh
@@ -7,8 +7,14 @@
|
||||
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
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user