Skip to content

Instantly share code, notes, and snippets.

@remi
Created February 1, 2010 16:27
Show Gist options
  • Save remi/291795 to your computer and use it in GitHub Desktop.
Save remi/291795 to your computer and use it in GitHub Desktop.
diff --git a/svn-color.sh b/svn-color.sh
index ac9d15b..6c8c90e 100755
--- a/svn-color.sh
+++ b/svn-color.sh
@@ -12,14 +12,14 @@ function svn
test "$CMDLEN" = "${#CMD}"
if [ $? = 1 ] || [ ! -t 1 ]
then
- $(whereis svn) $CMD
+ $(which svn) $CMD
return
fi
# actions that outputs "status-like" data
if [[ "$1" =~ ^(st|add) ]]
then
- $(whereis svn) $CMD | while IFS= read RL
+ $(which svn) $CMD | while IFS= read RL
do
if [[ $RL =~ ^\ ?M ]]; then C="\033[34m";
elif [[ $RL =~ ^\ ?C ]]; then C="\033[41m\033[37m\033[1m";
@@ -37,7 +37,7 @@ function svn
# actions that outputs "diff-like" data
elif [[ "$1" =~ ^diff ]]
then
- $(whereis svn) $CMD | while IFS= read RL
+ $(which svn) $CMD | while IFS= read RL
do
if [[ $RL =~ ^Index:\ ]]; then C="\033[34m\033[1m";
elif [[ $RL =~ ^@@ ]]; then C="\033[37m";
@@ -60,7 +60,7 @@ function svn
echo -e "$C$RL\033[0m\033[0;0m"
done
else
- $(whereis svn) $CMD
+ $(which svn) $CMD
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment