Fixed tests on systems where bash is not /bin/bash

Some systems, such as BSD, have bash stored in /usr/local/bin

Remove the assumption that bash is /bin/bash

Github issue #60
This commit is contained in:
Duncan Ferguson 2016-04-08 20:46:51 +01:00
parent 754a7137b6
commit 454f30978d
7 changed files with 25 additions and 9 deletions

View file

@ -226,7 +226,10 @@ sub expand_glob {
if ( grep {m/[{]/} @items ) {
#@expanded = split / /, `/bin/bash -c 'shopt -s extglob\n echo @items'`;
my $cmd = $self->parent->config->{shell_expansion};
my $shell = $self->config->find_binary(
$self->parent->config->{shell} );
my $cmd
= $shell . q{ } . $self->parent->config->{shell_expansion};
$cmd =~ s/%items%/@items/;
@expanded = split / /, `$cmd`;
chomp(@expanded);