option —latest

homebrew.sh & kymsu2.sh:
-ajout d’une option —latest pour afficher les casks ‘latest’
This commit is contained in:
2020-10-30 11:42:01 +01:00
parent d368c37788
commit f77903f01d

View File

@@ -23,6 +23,8 @@ declare -a do_not_update=()
# No distract mode (no user interaction)(Casks with 'latest' version number won't be updated)
no_distract=false
latest=false
#
###############################################################################################
#
@@ -49,6 +51,10 @@ if [[ $1 == "--nodistract" ]]; then
no_distract=true
fi
if [[ $1 == "--latest" ]]; then
latest=true
fi
echo -e "\033[1m🍺 Homebrew \033[0m"
echo ""
@@ -411,9 +417,13 @@ else
if [ "$choice" == "y" ] || [ "$choice" == "Y" ]; then
echo "$i" | awk '{print $1}' | xargs -p -n 1 brew upgrade homebrew/cask/$i
retCode=$?
echo "code retour: $retCode"
echo ""
elif [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
brew upgrade homebrew/cask/$i
retCode=$?
echo "code retour: $retCode"
echo ""
fi
@@ -431,7 +441,7 @@ else
echo ""
if [ -n "$upd_casks_latest" ] && [ "$no_distract" = false ]; then
if [ -n "$upd_casks_latest" ] && [ "$latest" == true ]; then
echo -e "\033[1;41m $nb_upd_casks_latest \033[0m \033[4mCasks (latest) updates:\033[0m"