File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -121,12 +121,13 @@ for my $file (@ARGV) {
121121 : " blastx -task blastx-fast -seg no"
122122 ;
123123
124- my $cmd = " (any2fasta -q -u \Q $file \E |"
125- . " $blastcmd -db \Q $db_path \E -outfmt '$format ' -num_threads $threads "
124+ my $cmd = " bash -c 'set -euo pipefail;"
125+ . " any2fasta -q -u \Q $file \E |"
126+ . " $blastcmd -db \Q $db_path \E -outfmt \" $format \" -num_threads $threads "
126127 . " -evalue 1E-20 -culling_limit $CULL "
127128 . " -max_target_seqs 10000" # https://github.com/tseemann/abricate/issues/135
128129# . " -max_target_seqs ".$dbinfo->{SEQUENCES} # Issue #76
129- . " ) "
130+ . " ' "
130131 ;
131132
132133 msg(" Running: $cmd " ) if $debug ;
@@ -183,6 +184,12 @@ for my $file (@ARGV) {
183184 ];
184185 }
185186 close BLAST;
187+ # Check the exit status of BLAST handle and abort
188+ my $exitcode = $? >> 8;
189+ if ($exitcode != 0) {
190+ msg(" Command exited with non-zero exit code $exitcode . Aborting Abricate." );
191+ exit ($exitcode );
192+ }
186193
187194 msg(" Found" , scalar (@hit ), " genes in $file " );
188195
You can’t perform that action at this time.
0 commit comments