Subject: | Files cannot be gathered from a non-default root |
This config in my plugin bundle failed:
[Git::GatherDir / default minting profile]
root = share/profiles/github
prefix = share/profiles/default
The stack trace:
[default minting profile] Module.pm does not exist!
[default minting profile] Module.pm does not exist! at /Users/ether/.perlbrew/libs/21.6@std/lib/perl5/Log/Dispatchouli.pm line 308.
Log::Dispatchouli::log(Log::Dispatchouli=HASH(0x7fb3741b5168), HASH(0x7fb3746f0130), "Module.pm does not exist!") called at /Users/ether/.perlbrew/libs/21.6@std/lib/perl5/Log/Dispatchouli/Proxy.pm line 105
Log::Dispatchouli::Proxy::log(Log::Dispatchouli::Proxy=HASH(0x7fb3752484e0), HASH(0x7fb3746f0130), "Module.pm does not exist!") called at /Users/ether/.perlbrew/libs/21.6@std/lib/perl5/Log/Dispatchouli/Proxy.pm line 114
Log::Dispatchouli::Proxy::log_fatal(Log::Dispatchouli::Proxy=HASH(0x7fb3752484e0), "Module.pm does not exist!") called at /Users/ether/.perlbrew/libs/21.6@std/lib/perl5/darwin-2level/Moose/Meta/Method/Delegation.pm line 110
Dist::Zilla::Plugin::GatherDir::log_fatal(Dist::Zilla::Plugin::Git::GatherDir=HASH(0x7fb3747d01d8), "Module.pm does not exist!") called at /Users/ether/.perlbrew/libs/21.6@std/lib/perl5/Dist/Zilla/Plugin/GatherDir.pm line 225
Dist::Zilla::Plugin::GatherDir::_file_from_filename(Dist::Zilla::Plugin::Git::GatherDir=HASH(0x7fb3747d01d8), Path::Tiny=ARRAY(0x7fb378981f10)) called at /Users/ether/.perlbrew/libs/21.6@std/lib/perl5/Dist/Zilla/Plugin/Git/GatherDir.pm line 83
Dist::Zilla::Plugin::Git::GatherDir::__ANON__[/Users/ether/.perlbrew/libs/21.6@std/lib/perl5/Dist/Zilla/Plugin/Git/GatherDir.pm:96](Dist::Zilla::Plugin::Git::GatherDir=HASH(0x7fb3747d01d8)) called at /Users/ether/.perlbrew/libs/21.6@std/lib/perl5/darwin-2level/Moose/Meta/Method/Overridden.pm line 38
Dist::Zilla::Plugin::Git::GatherDir::gather_files(Dist::Zilla::Plugin::Git::GatherDir=HASH(0x7fb3747d01d8)) called at /Users/ether/.perlbrew/libs/21.6@std/lib/perl5/Dist/Zilla/Dist/Builder.pm line 317
Dist::Zilla::Dist::Builder::build_in(Dist::Zilla::Dist::Builder=HASH(0x7fb374737930)) called at /Users/ether/.perlbrew/libs/21.6@std/lib/perl5/Dist/Zilla/Dist/Builder.pm line 302
Dist::Zilla::Dist::Builder::build(Dist::Zilla::Dist::Builder=HASH(0x7fb374737930)) called at /Users/ether/.perlbrew/libs/21.6@std/lib/perl5/Dist/Zilla/App/Command/build.pm line 66
Dist::Zilla::App::Command::build::execute(Dist::Zilla::App::Command::build=HASH(0x7fb373980368), Getopt::Long::Descriptive::Opts::__OPT__::2=HASH(0x7fb373a3a8a8), ARRAY(0x7fb371bd4da0)) called at /Users/ether/.perlbrew/libs/21.6@std/lib/perl5/App/Cmd.pm line 445
App::Cmd::execute_command(Dist::Zilla::App=HASH(0x7fb371832348), Dist::Zilla::App::Command::build=HASH(0x7fb373980368), Getopt::Long::Descriptive::Opts::__OPT__::2=HASH(0x7fb373a3a8a8)) called at /Users/ether/.perlbrew/libs/21.6@std/lib/perl5/App/Cmd.pm line 312
App::Cmd::run("Dist::Zilla::App") called at /Users/ether/.perlbrew/libs/21.6@std/bin/dzil line 12
_file_from_filename is being passed 'Module.pm', when it should be 'share/profiles/github/Module.pm' (the location of the source file).
This patch fixes it (line 83):
- push @files, $self->_file_from_filename($filename);
+ push @files, $self->_file_from_filename(Path::Tiny::path($root, $filename)->stringify);