gitperldist-zilla

Add one untracked file with Dist::Zilla::Plugin::Gatherdir


I am using Dist::Zilla to build a Perl module. I have replaced the standard GatherDir with Git::GatherDir. But my main module lib/XY.pm is generated and therefore not under version control. How can I add it?


Solution

  • You say "my main module lib/XY.pm is generated", but not how. That could be a significant component in finding the best answer. If the file was being generated by part of Dist-Zilla's operation, you'd want that action to also gather the file.

    Let's assume that you're not, though, and that some other program writes this file to the filesystem, but doesn't put it in git. Now you've added a bunch of things from ./lib to the dist, but you want to add one more file that isn't in git. You want to use the GatherFile plugin. It exists specifically to add one file to the dist.

    [GatherFile]
    filename = lib/XY.pm