Skip to content

Commit

Permalink
prefer a global diff-highlight, but fallback to our local copy
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Feb 10, 2016
1 parent 1544df3 commit 8e5da94
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions diff-so-fancy
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@

[ $# -ge 1 -a -f "$1" ] && input="$1" || input="-"

diff_highlight="$( cd "$( dirname realpath "${BASH_SOURCE[0]}" )" && pwd )/third_party/diff-highlight/diff-highlight"

hash gsed 2>/dev/null && SED=gsed || SED=sed

if hash diff-highlight 2> /dev/null; then
diff_highlight=diff-highlight
else
diff_highlight="$( cd "$( dirname $(realpath "${BASH_SOURCE[0]}") )" && pwd )/third_party/diff-highlight/diff-highlight"
fi

color_code_regex=$'(\x1B\\[([0-9]{1,2}(;[0-9]{1,2})?)[m|K])?'
reset_color="\x1B\[m"
dim_magenta="\x1B\[38;05;146m"
Expand Down

0 comments on commit 8e5da94

Please sign in to comment.