ENH don't require colordiff when diff can be colorful itself

This commit is contained in:
Nathan Dwarshuis 2022-05-21 00:17:12 -04:00
parent b6e54cc838
commit 013165a8c4
1 changed files with 7 additions and 1 deletions

View File

@ -221,6 +221,13 @@ alias uuu='cd ../../..'
alias uuuu='cd ../../../..'
alias uuuuu='cd ../../../../..'
## diff is weird; only use color if ver >= 3.4
diffver="$(diff -v | grep -o '\([0-9]\+\.[0-9]\+\)')"
if [ ${diffver//\.*/} -ge 3 ] && [ ${diffver//*\./} -ge 4 ]; then
alias diff='diff --color'
fi
## don't assume the rest of these will exist
alias_if grep \
@ -230,7 +237,6 @@ alias_if grep \
alias_if sudo sudo='sudo '
alias_if_else colordiff diff=colordiff 'diff --color'
if ! alias_if exa \
ll='exa -alhg --group-directories-first' \