Skip to content

Commit

Permalink
Merge pull request #308 from stmuk/master
Browse files Browse the repository at this point in the history
result of update-subtree.pl ext/Shell__Command
  • Loading branch information
lizmat committed Apr 20, 2016
2 parents 56e95bc + afee4e0 commit 172c434
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ext/Shell__Command/META.info
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"Test"
],
"depends" : [
"File::Find",
"File::Which"
"File::Which",
"File::Find"
],
"provides" : {
"Shell::Command" : "lib/Shell/Command.pm"
Expand Down
9 changes: 7 additions & 2 deletions ext/Shell__Command/lib/Shell/Command.pm
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,13 @@ sub dos2unix($file) is export {
}

sub which($name) is export {
require File::Which <&which>;
which($name)
warn "Please use File::Which instead for a more portable solution."
if $*DISTRO.is-win || $*DISTRO.name eq 'macosx';

for $*SPEC.path.map({ $*SPEC.catfile($^dir, $name) }) {
return $_ if .IO.x;
}
Str
}

# vim: ft=perl6
6 changes: 3 additions & 3 deletions ext/Shell__Command/t/02-shell-command.t
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ lives-ok { cp 't/dir1/file.foo', 't/dir2'; }, '#5';
ok 't/dir2/file.foo'.IO.f, '#5';
rm_rf 't/dir2';

if $*DISTRO.is-win {
ok which('perl6'), 'which - perl6 is found';
if $*DISTRO.is-win || ($*DISTRO.name eq 'macosx') {
skip 'which is not working properly on Windows/Mac OS X. Please use File::Which', 2;
} else {
ok which('perl6').IO.x, 'which - perl6 is found';
nok which('scoodelyboopersnake'), 'which - missing exe is false';
}
nok which('scoodelyboopersnake'), 'which - missing exe is false';

0 comments on commit 172c434

Please sign in to comment.