-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmymeta
More file actions
executable file
·34 lines (28 loc) · 745 Bytes
/
mymeta
File metadata and controls
executable file
·34 lines (28 loc) · 745 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env perl
use v5.34.0;
use warnings;
use File::stat;
use Term::ANSIColor;
my @perl_inc = `perl -E 'say for grep { m{/.plenv/versions/} } \@INC'`;
chomp @perl_inc;
my @lines = `find @perl_inc -name MYMETA.json`;
chomp @lines;
my %mtime;
for my $line (@lines) {
my ($dist) = $line =~ m{/([^/]+)/MYMETA.json\z};
my $mtime = stat($line)->mtime;
$mtime{$dist} = $mtime;
}
my $prev = 0;
for my $dist (sort { $mtime{$a} <=> $mtime{$b} } keys %mtime) {
my $mtime = $mtime{$dist};
if ($mtime - $prev > 3600) {
print "\n";
printf "%s %s %s\n",
colored(['bright_cyan'], '==['),
colored(['bright_yellow'], scalar localtime $mtime),
colored(['bright_cyan'], ']==');
}
$prev = $mtime;
say "$dist";
}