git branch --color=always works fine - no need for script

This commit is contained in:
Nathan Broadbent
2012-08-21 14:26:14 +12:00
parent fb68e6e470
commit 25e8759211

View File

@@ -20,20 +20,9 @@ function _scmb_git_branch_shortcuts {
return 1
fi
local git_branch_command="$_git_cmd branch --color=always \\\"$@\\\""
if [ "$_uname" = "Linux" ]; then
# Linux
local script_git_branch_command="script -q -c \"$git_branch_command\" /dev/null"
elif [ "$_uname" = "Darwin" ]; then
# OS X
local script_git_branch_command="script -q /dev/null \"$git_branch_command\""
fi
# Use ruby to inject numbers into ls output
ruby -e "$( cat <<EOF
output = %x($script_git_branch_command)
output = %x($_git_cmd branch --color=always $@)
line_count = output.lines.to_a.size
output.lines.each_with_index do |line, i|
spaces = (line_count > 9 && i < 9 ? " " : " ")