#!/bin/zsh brew_tmux_path="$( brew info tmux | perl -naE '/[*]$/ and say($F[0])' )" tmux_installed="${${brew_tmux_path//*HEAD-/}%_1}" tmux_head=$(cd $HOME/git_tree/tmux && git pull &> /dev/null && git ls -1 | awk '{print $1}') tmux_head_short=${tmux_head:0:7} if [[ "$tmux_head_short" == "$tmux_installed" ]]; then update_status="$(tput setaf 33)Already up to date.$(tput sgr0)" else update_status="$(tput setaf 10)Update available!$(tput sgr0)" fi [[ -n "$VERBOSE" ]] && echo -e "tmux.git HEAD: $tmux_head_short\ninstalled ver: $tmux_installed" echo "$update_status"