git branch --color=always works fine - no need for script
This commit is contained in:
@@ -20,20 +20,9 @@ function _scmb_git_branch_shortcuts {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
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
|
# Use ruby to inject numbers into ls output
|
||||||
ruby -e "$( cat <<EOF
|
ruby -e "$( cat <<EOF
|
||||||
output = %x($script_git_branch_command)
|
output = %x($_git_cmd branch --color=always $@)
|
||||||
line_count = output.lines.to_a.size
|
line_count = output.lines.to_a.size
|
||||||
output.lines.each_with_index do |line, i|
|
output.lines.each_with_index do |line, i|
|
||||||
spaces = (line_count > 9 && i < 9 ? " " : " ")
|
spaces = (line_count > 9 && i < 9 ? " " : " ")
|
||||||
|
|||||||
Reference in New Issue
Block a user