next unless $metadata->name;
my $sha = Digest::SHA->new(256);
$sha->addfile($line);
+ my $version = $metadata->version;
push @{ $module{ $metadata->name } //= [] }, {
file => $line,
- version => $metadata->version,
+ version => (
+ defined($version)
+ ? sprintf('%s', $version)
+ : undef
+ ),
size => scalar(-s $line),
sha256_hex => $sha->hexdigest,
};