【发布时间】:2012-10-12 20:10:35
【问题描述】:
默认情况下,如果Dist::Zilla 找不到版权年份,它将使用当前年份,因为它似乎不支持多个年份或年份范围,我认为当前年份最合适。但是,每当我运行dzil new Module 时,它会自动将版权年份插入我的dist.ini。有没有办法阻止 Dist::Zilla 这样做?
【问题讨论】:
标签: perl dist-zilla
默认情况下,如果Dist::Zilla 找不到版权年份,它将使用当前年份,因为它似乎不支持多个年份或年份范围,我认为当前年份最合适。但是,每当我运行dzil new Module 时,它会自动将版权年份插入我的dist.ini。有没有办法阻止 Dist::Zilla 这样做?
【问题讨论】:
标签: perl dist-zilla
从您的铸币配置文件中删除 [DistINI],并改用带有 GatherDir::Template 的模板 dist.ini 文件。这更加灵活。
例如,这是我的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)$
然后我的profile.ini 包括:
[GatherDir::Template]
root = skel
include_dotfiles = 1 ; want .gitignore
【讨论】:
[DistINI] 插件更可配置地包括哪些部分,所以像作者加入这样的逻辑,许可证选择不必在模板中。另外,既然copyright_year 在配置中完全是可选的,为什么还要在[DistINI] 插件中包含copyright_year?似乎是一个糟糕的默认值。