BedrockStation/install_icon.pl

32 lines
980 B
Perl
Raw Normal View History

2024-08-05 18:47:20 +02:00
use v5.38.2;
use strict;
use warnings;
use Path::Tiny;
my %sizes = qw{res/mipmap-hdpi/ic_launcher.webp 72x72
res/mipmap-hdpi/ic_launcher_round.webp 72x72
res/mipmap-mdpi/ic_launcher.webp 48x48
res/mipmap-mdpi/ic_launcher_round.webp 48x48
res/mipmap-xhdpi/ic_launcher.webp 96x96
res/mipmap-xhdpi/ic_launcher_round.webp 96x96
res/mipmap-xxhdpi/ic_launcher.webp 144x144
res/mipmap-xxhdpi/ic_launcher_round.webp 144x144
res/mipmap-xxxhdpi/ic_launcher.webp 192x192
res/mipmap-xxxhdpi/ic_launcher_round.webp 192x192};
my $svg = 'cube.svg';
my $svg_pro = 'cube-pro.svg';
for my $key (keys %sizes) {
my $route_pro = 'app/src/pro/'.$key;
my $route_free = 'app/src/free/'.$key;
path($route_pro)->parent->mkpath;
path($route_free)->parent->mkpath;
my $size = $sizes{$key};
system 'rm', '-v', $route_pro;
system 'rm', '-v', $route_free;
system 'convert', $svg_pro, '-resize', $size, $route_pro;
system 'convert', $svg, '-resize', $size, $route_free;
}