diff options
author | Cody Hiar <codyfh@gmail.com> | 2017-04-20 19:37:10 -0600 |
---|---|---|
committer | Cody Hiar <codyfh@gmail.com> | 2017-04-20 19:37:10 -0600 |
commit | 2dd809781527976307b47a598887062047e202c9 (patch) | |
tree | 8b29daba2c1ef072f380ef530b7e7d9256e43eb3 /segments/vcs_revision.sh | |
parent | baeb698bb006193559fc5aa1901180a3ccc73b7a (diff) |
Making tmux configuration much easier to manage
Diffstat (limited to 'segments/vcs_revision.sh')
-rwxr-xr-x | segments/vcs_revision.sh | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/segments/vcs_revision.sh b/segments/vcs_revision.sh deleted file mode 100755 index 0ff0f74..0000000 --- a/segments/vcs_revision.sh +++ /dev/null @@ -1,43 +0,0 @@ -# This prints the vcs revision in the working directory -# currently only used in SVN - -# Source lib to get the function get_tmux_pwd -source "${TMUX_POWERLINE_DIR_LIB}/tmux_adapter.sh" - -run_segment() { - tmux_path=$(get_tmux_cwd) - cd "$tmux_path" - - stats="" - if [[ -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" ]]; then - echo "${stats}" - fi -} - -__parse_hg_stats(){ - type hg >/dev/null 2>&1 - if [ "$?" -ne 0 ]; then - return - fi - # not yet implemented -} -__parse_svn_stats(){ - type svn >/dev/null 2>&1 - if [ "$?" -ne 0 ]; then - return - fi - - local svn_info=$(svn info 2>/dev/null) - if [ -z "${svn_info}" ]; then - return - fi - - local svn_ref=$(echo "${svn_info}" | sed -ne 's#^Revision: ##p') - - echo "r${svn_ref}" -} |