2

By default if Dist::Zilla finds no copyright year it will use the current year, since it doesn't seem to support multiple years or year ranges I find the current year to be most appropriate. However, whenever I run dzil new Module it automatically inserts the copyright year into my dist.ini. Is there a way to prevent Dist::Zilla from doing this?

xenoterracide
  • 16,274
  • 24
  • 118
  • 243

1 Answers1

1

Remove [DistINI] from your minting profile, and use a template dist.ini file with GatherDir::Template instead. That's much more flexible.

As an example, here's my skel/dist.ini:

;                                                       -*-conf-windows-*-{{
    $license = ref $dist->license;
    if ( $license =~ /^Software::License::(.+)$/ ) {
        $license = $1;
    } else {
        $license = "=$license";
    }

    $authors = join( "\n", map { "author  = $_" } @{$dist->authors} );
    '';
}}
name    = {{$dist->name}}
{{$authors}}
license = {{$license}}
copyright_holder = {{$dist->copyright_holder}}

[@Author::CJM / CJM]

[AutoPrereqs]
skip = ^(?:lib|strict|utf8|warnings)$

And then my profile.ini includes:

[GatherDir::Template]
root = skel
include_dotfiles = 1 ; want .gitignore
cjm
  • 61,471
  • 9
  • 126
  • 175
  • Exactly! This is also what I would do. – rjbs Oct 23 '12 at 11:52
  • it appears I did the templating too (in a long lost set of minters at home) ... except I didn't bother with funky logic, I just copied my license, copyright holder, etc. There doesn't really appear to be any advantage to not doing that. – xenoterracide Oct 23 '12 at 17:22
  • @rjbs why can't be just make the `[DistINI]` plugin more configurable as to which sections to include, so logic like authors join, and license selection don't have to be in templates. Also why include `copyright_year` at all in the `[DistINI]` plugin given that it's completely optional in the config? seems like a bad default maybe. – xenoterracide Oct 23 '12 at 17:50