update pip & npm

pip:
#add module to do_not_update array

npm:
#add help to install
This commit is contained in:
2018-04-26 07:45:20 +02:00
parent 05dd371daf
commit 9fba1cb68b
2 changed files with 29 additions and 8 deletions

13
_npm.sh
View File

@@ -3,6 +3,19 @@
# npm plugin for KYMSU (install local package)
# https://github.com/welcoMattic/kymsu
# Fixing npm On Mac OS X for Homebrew Users
# https://gist.github.com/rcugut/c7abd2a425bb65da3c61d8341cd4b02d
# https://gist.github.com/DanHerbert/9520689
# brew install node
# node -v => 9.11.1
# npm -v => 5.6.0
# npm install -g npm
# npm -v => 5.8.0
# https://github.com/npm/npm/issues/17744
echo " 🌿 npm"
cd /Users/bruno/Sites/node_modules/
npm ls

24
_pip.sh
View File

@@ -7,6 +7,8 @@
version=pip3
#user: "" or "--user"
user=""
#add module to do_not_update array
declare -a do_not_update=( "tornado")
if ! [ -x "$(command -v $version)" ]; then
echo "Error: $version is not installed." >&2
@@ -54,15 +56,21 @@ if [ -n "$upd" ]; then
done <<< "$dependencies"
fi
b=$(echo -e "Do you wanna run \033[1m$version install $user --upgrade "$i"\033[0m ? (y/n)")
read -p "$b" choice
case "$choice" in
y|Y|o ) echo $i | xargs $version install $user --upgrade ;;
n|N ) echo "Ok, let's continue";;
* ) echo "invalid";;
esac
echo ""
# si la m-à-j n'est pas dans le tableau do_not_update, on propose de l'installer
FOUND=`echo ${do_not_update[*]} | grep "$i"`
if [ "${FOUND}" = "" ]; then
b=$(echo -e "Do you wanna run \033[1m$version install $user --upgrade "$i"\033[0m ? (y/n)")
read -p "$b" choice
case "$choice" in
y|Y|o ) echo $i | xargs $version install $user --upgrade ;;
n|N ) echo "Ok, let's continue";;
* ) echo "invalid";;
esac
echo ""
fi
done
else