comparison easyhg-extdiff.sh @ 274:24820581e532

* Use kdiff3 from path if present; return sensible return code
author Chris Cannam
date Thu, 10 Feb 2011 18:49:01 +0000
parents f6b71fda5957
children a1c8630a0057
comparison
equal deleted inserted replaced
273:cc95394e2392 274:24820581e532
1 #!/bin/bash 1 #!/bin/bash -x
2 p=`dirname $0` 2 p=`dirname $0`
3 if [ $# -lt 2 ]; then 3 if [ $# -lt 2 ]; then
4 echo Insufficient arguments: $@ 4 echo Insufficient arguments: $@
5 exit 2 5 exit 2
6 fi 6 fi
11 for d in kdiff3 kdiff3.exe; do 11 for d in kdiff3 kdiff3.exe; do
12 if [ -x "$p/$d" ]; then 12 if [ -x "$p/$d" ]; then
13 found=true 13 found=true
14 "$p/$d" "$1" "$2" 14 "$p/$d" "$1" "$2"
15 break 15 break
16 elif [ -x "$(type -path $d)" ]; then
17 found=true
18 "$d" "$1" "$2"
19 break;
16 fi 20 fi
17 done 21 done
18 if [ -z "$found" ]; then 22 if [ -z "$found" ]; then
19 od=/usr/bin/opendiff 23 od=/usr/bin/opendiff
20 if [ -x "$od" ]; then 24 if [ -x "$od" ]; then
25 found=true
21 "$od" "$1" "$2" | cat 26 "$od" "$1" "$2" | cat
22 fi 27 fi
23 fi 28 fi
29 [ -z "$found" ]
30