Last active
January 30, 2020 16:46
-
-
Save dwarring/079d02989ded07d550a08f19bfbff400 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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