Skip to content

Instantly share code, notes, and snippets.

@dwarring
Last active January 30, 2020 16:46
Show Gist options
  • Save dwarring/079d02989ded07d550a08f19bfbff400 to your computer and use it in GitHub Desktop.
Save dwarring/079d02989ded07d550a08f19bfbff400 to your computer and use it in GitHub Desktop.
use JSON::Fast;
sub MAIN(Str $meta6 = 'META6.json') {
## rename modules
my Hash $meta = from-json($meta6.IO.slurp);
my $module-updates = 0;
my $script-updates = 0;
for $meta<provides>.sort {
my $old = .value;
if .value ~~ s/\.pm[6?]$/.rakumod/ {
$module-updates++;
shell "git mv $old {.value}";
}
}
if $module-updates {
$meta6.IO.spurt: to-json($meta, :sorted-keys);
}
## rename scripts
if 'bin'.IO.e {
for dir 'bin' {
my $old = .Str;
my $new = .Str;
if $new ~~ s/\.p[l|6]$/.raku/ {
$script-updates++;
shell "git mv $old $new";
}
}
}
note "renamed $module-updates modules and $script-updates scripts";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment