package Psh
::Strategy
::Darwin_apps
;
This strategy will search for Mac OS X/Darwin .app bundles and
execute them using the system 'open' command'
@Psh::Strategy
::Darwin_apps
::ISA
=('Psh::Strategy');
return Psh
::Strategy
::CONSUME_TOKENS
;
opendir( DIR
, $dir) || return ();
my @result= map { Psh
::OS
::catdir
($dir,$_) }
grep { lc("$file.app") eq lc($_) } @files;
return $result[0] if @result;
foreach my $tmp (@files) {
my $tmpdir= Psh
::OS
::catdir
($dir,$tmp);
next if ! -d
$tmpdir || !Psh
::OS
::no_upwards
($tmp);
next if index($tmpdir,'.')>=0;
push @result, _recursive_search
($file, $tmpdir, $lvl+1);
return $result[0] if @result;
if ($com !~ m/$Psh::which_regexp/) { return ''; }
my $path=$ENV{APP_PATH
}||'/Applications';
my @path= split /:/, $path;
$executable= _recursive_search
($com,$_,1);
return $executable if defined $executable;
my $tmp= CORE
::system("/usr/bin/open $executable");
return ($tmp==0, undef, undef, $tmp);