antibody.sh

+antibody version
This commit is contained in:
2021-01-09 14:12:29 +01:00
parent 1061909d5b
commit a5c0c2b011

View File

@@ -15,8 +15,9 @@ display_info=true
# 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=('') declare -a do_not_update=('')
# No distract mode (no user interaction)(Casks with 'latest' version number won't be updated) # No distract mode (no user interaction)
no_distract=false [[ $@ =~ "--nodistract" ]] && no_distract=true || no_distract=false
# #
############################################################################################### ###############################################################################################
# #
@@ -26,6 +27,15 @@ no_distract=false
# #
############################################################################################### ###############################################################################################
italic="\033[3m"
underline="\033[4m"
ita_under="\033[3;4m"
bgd="\033[1;4;31m"
red="\033[1;31m"
bold="\033[1m"
box="\033[1;41m"
reset="\033[0m"
notification() { notification() {
sound="Basso" sound="Basso"
title="Antibody" title="Antibody"
@@ -42,14 +52,12 @@ notification() {
} }
if [[ $1 == "--nodistract" ]]; then
no_distract=true
fi
echo -e "\033[1m🙏 Antibody \033[0m"
echo ""
antibody_folder=$(antibody home) antibody_folder=$(antibody home)
antibody_version=$(antibody -v 2>&1 | awk '{print $3}')
echo -e "${bold}🙏 Antibody ${reset}\n"
echo -e "Current ${underline}Antibody${reset} version: $antibody_version\n"
update=$(antibody update 2>&1) update=$(antibody update 2>&1)
@@ -57,7 +65,7 @@ installed=$(echo "$update" | grep "updating")
updated=$(echo "$update" | grep "updated") updated=$(echo "$update" | grep "updated")
if [ -n "$installed" ]; then if [ -n "$installed" ]; then
echo -e "\033[4mAntibody modules installed:\033[0m" echo -e "${underline}Antibody modules installed:${reset}"
#echo "$installed" #echo "$installed"
IFS=$'\n' IFS=$'\n'
@@ -66,16 +74,18 @@ if [ -n "$installed" ]; then
do do
url=$(echo "$i" | awk '{print $3}') url=$(echo "$i" | awk '{print $3}')
module=$(echo "$i" | awk -F "/" '{print $NF}') module=$(echo "$i" | awk -F "/" '{print $NF}')
echo -e "\033[1m$module\033[0m ($url)" echo -e "${bold}$module${reset} ($url)"
done done
echo "" echo ""
echo "Modules are installed in $antibody_folder folder." echo "Modules are installed in $antibody_folder folder."
else else
echo -e "\033[4mNo Antibody modules installed.\033[0m" echo -e "${underline}No Antibody modules installed.${reset}"
fi fi
<<COMMENT <<COMMENT
antibody update:
antibody: updating: https://github.com/zsh-users/zsh-history-substring-search antibody: updating: https://github.com/zsh-users/zsh-history-substring-search
antibody: updating: https://github.com/zsh-users/zsh-completions antibody: updating: https://github.com/zsh-users/zsh-completions
antibody: updating: https://github.com/zsh-users/zsh-autosuggestions antibody: updating: https://github.com/zsh-users/zsh-autosuggestions
@@ -88,7 +98,7 @@ COMMENT
echo "" echo ""
if [ -n "$updated" ]; then if [ -n "$updated" ]; then
echo -e "\033[4mAntibody modules to update:\033[0m" echo -e "${underline}Antibody modules to update:${reset}"
#echo "$updated" #echo "$updated"
IFS=$'\n' IFS=$'\n'
@@ -98,20 +108,18 @@ if [ -n "$updated" ]; then
module=$(echo "$j" | awk -F "/" '{print $NF}' | awk '{print $1}') module=$(echo "$j" | awk -F "/" '{print $NF}' | awk '{print $1}')
commit=$(echo "$j" | awk -F "$url" '{print $NF}') commit=$(echo "$j" | awk -F "$url" '{print $NF}')
last_commit=$(echo "$commit" | awk '{print $NF}') last_commit=$(echo "$commit" | awk '{print $NF}')
echo -e "\033[1m$module\033[0m ($url)" echo -e "${bold}$module${reset} ($url)"
echo "Commits: $commit" echo "Commits: $commit"
echo "Last commit: "$url"/commits/"$last_commit echo "Last commit: "$url"/commits/"$last_commit
# https://github.com/zsh-users/zsh-completions/commits/ # https://github.com/zsh-users/zsh-completions/commits/
#notif="$module has been updated"
#notification "$notif"
modules+="$module " modules+="$module "
done done
notif="$modules has been updated" notif="$modules has been updated"
notification "$notif" notification "$notif"
else else
echo -e "\033[4mNo Antibody modules to update.\033[0m" echo -e "${underline}No Antibody modules to update.${reset}"
echo "" echo ""
fi fi