smarter about path finding

This commit is contained in:
Heng Li 2014-11-19 12:38:55 -05:00
parent d36083bdc5
commit d58beeee56
1 changed files with 1 additions and 0 deletions

View File

@ -55,6 +55,7 @@ my $idx = $ARGV[0];
my $exepath = $0 =~/^\S+\/[^\/\s]+/? $0 : &which($0);
my $root = $0 =~/^(\S+)\/[^\/\s]+/? $1 : undef;
$root = $exepath =~/^(\S+)\/[^\/\s]+/? $1 : undef if !defined($root);
die "ERROR: failed to locate the 'bwa.kit' directory\n" if !defined($root);
die("ERROR: failed to locate the BWA index. Please run '$root/bwa index -p $idx ref.fa'.\n")