Skip to content

Commit

Permalink
Make sure there is a path part to create path from
Browse files Browse the repository at this point in the history
Previously a META6.json containing a resource entry of `libraries/`
would cause an error when we tried to create an IO path from the
first child part (which doesn't exist in the given entry). This
fixes the regex for matching "libraries" by making sure an expected
path part actually exists.
  • Loading branch information
ugexe committed Sep 12, 2024
1 parent da187d3 commit 2f067ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Zef/Distribution/Local.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class Zef::Distribution::Local is Zef::Distribution {
my $lib-path = $res-path.child('libraries');

return %meta<resources>.grep(*.defined).map(-> $resource {
my $resource-path = $resource ~~ m/^libraries\/(.*)/
my $resource-path = $resource ~~ m/^libraries\/(.+)/
?? $lib-path.child($*VM.platform-library-name(IO::Path.new($0, :CWD($!path))))
!! $res-path.child($resource);
$resource => $resource-path.IO.is-relative
Expand Down

0 comments on commit 2f067ce

Please sign in to comment.