27-09-2020

-homebrew.sh
-pip.sh
-README.md
This commit is contained in:
2020-09-27 18:51:29 +02:00
parent 380967c8d4
commit 731142630b
3 changed files with 75 additions and 21 deletions

View File

@@ -11,9 +11,10 @@ homebrew and pecl plugins notifie you if apache/php configuration files have bee
## Plug-ins: ## Plug-ins:
- **atom** (plug-ins) - **atom** (plug-ins)
- **antibody** (zsh plug-ins)
- **homebrew** (brew and cask) - **homebrew** (brew and cask)
- **installed** (create a list of all your brew, pip, npm... stuffs and a Brewfile). - **installed** (create a list of all your brew, pip, npm... stuffs and a Brewfile).
- **npm** (javascript package) (local or global packages) - **npm** (javascript package) (local or global packages) (can update nvm script)
- **mas** (Mac Appstore) - **mas** (Mac Appstore)
- **pip** (Python Package index) (pip or pip3) - **pip** (Python Package index) (pip or pip3)
- **PECL** (PHP modules) - **PECL** (PHP modules)

View File

@@ -18,7 +18,8 @@ display_info=true
# Casks don't have pinned cask. So add Cask to the do_not_update array for prevent to update. # Casks don't have pinned cask. So add Cask to the do_not_update array for prevent to update.
# Also add package for prevent to update whitout pin it. # Also add package for prevent to update whitout pin it.
declare -a do_not_update=("xnconvert" "yate") # do_not_update=("xnconvert" "yate")
declare -a do_not_update=("xnconvert")
# No distract mode (no user interaction)(Casks with 'latest' version number won't be updated) # No distract mode (no user interaction)(Casks with 'latest' version number won't be updated)
no_distract=false no_distract=false
@@ -296,6 +297,17 @@ echo ""
echo -e "\033[1m🍺 Casks upgrade \033[0m" echo -e "\033[1m🍺 Casks upgrade \033[0m"
echo "" echo ""
if (( ${#do_not_update[@]} )); then
nbp=$(echo "$do_not_update" | wc -w | xargs)
echo -e "\033[4mList of\033[0m \033[1;41m $nbp \033[0m \033[4m'do not update' packages:\033[0m"
echo -e "\033[1;31m$do_not_update\033[0m"
echo "To remove package from this list, you need to edit the do_not_update array."
echo ""
fi
echo "Search for Casks update..." echo "Search for Casks update..."
echo "" echo ""
@@ -374,27 +386,47 @@ else
#brew cask info betterzip #brew cask info betterzip
# boucle for: don't stop multiples updates if one block (bad checksum, not compatible with OS version (Onyx)) ##########
if [ "$no_distract" = false ]; then
for i in $upd_casks a=$(echo -e "Do you wanna run \033[1;37mbrew upgrade homebrew/cask/$upd_casks\033[0m ? (y/n/a)")
do # yes/no/all
FOUND=`echo ${do_not_update[*]} | grep "$i"` read -p "$a" choice
if [ "${FOUND}" == "" ]; then if [ "$choice" == "y" ] || [ "$choice" == "Y" ] || [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
# boucle for: don't stop multiples updates if one block (bad checksum, not compatible with OS version (Onyx))
for i in $upd_casks
do
FOUND=`echo ${do_not_update[*]} | grep "$i"`
if [ "${FOUND}" == "" ]; then
#echo "$i" | xargs brew cask reinstall #echo "$i" | xargs brew cask reinstall
#echo "$i" | xargs -p -n 1 brew reinstall #echo "$i" | xargs -p -n 1 brew reinstall
#echo "$i" | xargs -p -n 1 brew upgrade --cask #echo "$i" | xargs -p -n 1 brew upgrade --cask
b=$(echo -e "Do you wanna run \033[1;37mbrew upgrade homebrew/cask/$i\033[0m ? (y/n)") #b=$(echo -e "Do you wanna run \033[1;37mbrew upgrade homebrew/cask/$i\033[0m ? (y/n)")
read -p "$b" choice #read -p "$b" choice
if [ "$choice" == "y" ]; then if [ "$choice" == "y" ] || [ "$choice" == "Y" ]; then
brew upgrade homebrew/cask/$i echo "$i" | awk '{print $1}' | xargs -p -n 1 brew upgrade homebrew/cask/$i
echo "" echo ""
fi elif [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
brew upgrade homebrew/cask/$i
echo ""
fi
fi
done
else
echo "Ok, let's continue"
fi fi
done else # no distract = true
echo "no distract"
fi
#########
fi fi
echo "" echo ""
@@ -440,17 +472,23 @@ else
echo "" echo ""
q=$(echo -e "Do you wanna run \033[1;37mbrew upgrade --cask --greedy <cask>\033[0m ? (y/n)") q=$(echo -e "Do you wanna run \033[1;37mbrew upgrade --cask --greedy <cask>\033[0m ? (y/n/a)")
read -p "$q" choice read -p "$q" choice
if [ "$choice" == "y" ]; then if [ "$choice" == "y" ] || [ "$choice" == "Y" ] || [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
for i in $upd_casks_latest for i in $upd_casks_latest
do do
FOUND=`echo ${do_not_update[*]} | grep "$i"` FOUND=`echo ${do_not_update[*]} | grep "$i"`
if [ "${FOUND}" == "" ]; then if [ "${FOUND}" == "" ]; then
echo "$i" | xargs -p -n 1 brew upgrade --cask --greedy
echo "" if [ "$choice" == "y" ] || [ "$choice" == "Y" ]; then
echo "$i" | xargs -p -n 1 brew upgrade --cask --greedy
echo ""
elif [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
echo "$i" | xargs -n 1 brew upgrade --cask --greedy
echo ""
fi
fi fi
done done
else else

View File

@@ -21,7 +21,8 @@ user=""
# No distract mode # No distract mode
no_distract=false no_distract=false
#add module to do_not_update array #add module to do_not_update array
declare -a do_not_update=() #declare -a do_not_update=()
declare -a do_not_update=('parso')
# #
######################################### #########################################
@@ -43,12 +44,25 @@ echo ""
$pip_version install --upgrade pip $pip_version install --upgrade pip
echo "" echo ""
if (( ${#do_not_update[@]} )); then
nbp=$(echo "$do_not_update" | wc -w | xargs)
echo -e "\033[4mList of\033[0m \033[1;41m $nbp \033[0m \033[4m'do not update' packages:\033[0m"
echo -e "\033[1;31m$do_not_update\033[0m"
echo "To remove package from this list, you need to edit the do_not_update array."
echo ""
fi
pip_outdated=$($pip_version list --outdated --format columns) pip_outdated=$($pip_version list --outdated --format columns)
upd=$(echo "$pip_outdated" | sed '1,2d' | awk '{print $1}') upd=$(echo "$pip_outdated" | sed '1,2d' | awk '{print $1}')
if [ -n "$upd" ]; then if [ -n "$upd" ]; then
echo -e "\033[4mAvailables updates:\033[0m" nb=$(echo "$upd" | wc -w | xargs)
echo -e "\\033[1;41m $nb \033[0m \033[4mavailables updates:\033[0m"
#echo $pip3_outdated_freeze | tr [:space:] '\n' #echo $pip3_outdated_freeze | tr [:space:] '\n'
echo "$pip_outdated" echo "$pip_outdated"
echo "" echo ""
@@ -126,6 +140,7 @@ else
fi fi
echo ""
echo -e "🐍 Running \033[1mpip check\033[0m for checking that everything is ok." echo -e "🐍 Running \033[1mpip check\033[0m for checking that everything is ok."
$pip_version check $pip_version check