From f77903f01d21d5c14659e9c084d70cb6cff1fb10 Mon Sep 17 00:00:00 2001 From: Bruno 21 Date: Fri, 30 Oct 2020 11:42:01 +0100 Subject: [PATCH] =?UTF-8?q?option=20=E2=80=94latest?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit homebrew.sh & kymsu2.sh: -ajout d’une option —latest pour afficher les casks ‘latest’ --- plugins.d/homebrew.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/plugins.d/homebrew.sh b/plugins.d/homebrew.sh index 1957d62..5db86a5 100755 --- a/plugins.d/homebrew.sh +++ b/plugins.d/homebrew.sh @@ -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"