使用 Dist::Zilla::Plugin::Gatherdir 添加一个未跟踪的文件

时间:2021-08-01 15:35:38

标签: git perl dist-zilla

我正在使用 Dist::Zilla 构建 Perl 模块。我已将标准 GatherDir 替换为 Git::GatherDir。但是我的主模块 lib/XY.pm 是生成的,因此不受版本控制。如何添加?

2 个答案:

答案 0 :(得分:1)

您说“我的主模块 lib/XY.pm 已生成”,但不是如何生成。这可能是找到最佳答案的重要组成部分。如果文件是由 Dist-Zilla 操作的一部分生成的,您希望该操作也收集该文件。

让我们假设您不是,并且其他一些程序将此文件写入文件系统,但未将其放入 git 中。现在你已经从 ./lib 添加了一堆东西到 dist,但你想再添加一个不在 git 中的文件。您想使用 GatherFile 插件。专门为dist添加一个文件而存在。

[GatherFile]
filename = lib/XY.pm

答案 1 :(得分:0)

root 中运行 Git::GatherDir 后,您能否尝试使用特定的 dist.ini 属性运行 GatherDir。例如

# ...
[Git::GatherDir]
[GatherDir]
root=lib
# ...