From 2dd809781527976307b47a598887062047e202c9 Mon Sep 17 00:00:00 2001 From: Cody Hiar Date: Thu, 20 Apr 2017 19:37:10 -0600 Subject: Making tmux configuration much easier to manage --- segments/vcs_staged.sh | 57 -------------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100755 segments/vcs_staged.sh (limited to 'segments/vcs_staged.sh') diff --git a/segments/vcs_staged.sh b/segments/vcs_staged.sh deleted file mode 100755 index 8818b3c..0000000 --- a/segments/vcs_staged.sh +++ /dev/null @@ -1,57 +0,0 @@ -# This checks if the current branch is ahead of -# or behind the remote branch with which it is tracked - -# Source lib to get the function get_tmux_pwd -source "${TMUX_POWERLINE_DIR_LIB}/tmux_adapter.sh" - -staged_symbol="⊕ " - -run_segment() { - tmux_path=$(get_tmux_cwd) - cd "$tmux_path" - - stats="" - if [ -n "${git_stats=$(__parse_git_stats)}" ]; then - stats="$git_stats" - elif [ -n "${svn_stats=$(__parse_svn_stats)}" ]; then - stats="$svn_stats" - elif [ -n "${hg_stats=$(__parse_hg_stats)}" ]; then - stats="$hg_stats" - fi - if [[ -n "$stats" && $stats -gt 0 ]]; then - stats=$(echo $stats | sed -e "s/^[ \t]*//") - echo "${staged_symbol}${stats}" - fi - return 0 -} - - -__parse_git_stats(){ - type git >/dev/null 2>&1 - if [ "$?" -ne 0 ]; then - return - fi - - # Check if git. - [[ -z $(git rev-parse --git-dir 2> /dev/null) ]] && return - - # Return the number of staged items. - staged=$(git diff --staged --name-status | wc -l) - echo "$staged" -} - -__parse_hg_stats(){ - type svn >/dev/null 2>&1 - if [ "$?" -ne 0 ]; then - return - fi - # not yet implemented -} - -__parse_svn_stats(){ - type hg >/dev/null 2>&1 - if [ "$?" -ne 0 ]; then - return - fi - # not yet implemented -} -- cgit v1.2.3