diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/sharkey-icon-pack | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/bin/sharkey-icon-pack b/bin/sharkey-icon-pack new file mode 100755 index 0000000..8c2aec5 --- /dev/null +++ b/bin/sharkey-icon-pack @@ -0,0 +1,44 @@ +#!/usr/bin/env perl +use v5.40; +use Path::Tiny; +use JSON::MaybeXS; +use Getopt::Long::Descriptive; + +my ($opt,$usage) = describe_options( + "%c %o [ file ... ]\n", + [ 'category=s', 'icon category' ], + [ 'help|h', 'print usage message and exit', { shortcircuit => 1 } ], + { + getopt_conf => [qw( posix_default no_ignore_case )], + show_defaults => 1, + }, +); +if ($opt->help) { + print $usage->text; + exit 0; +} + +my @emojis; + +for my $file (@ARGV) { + push @emojis, { + downloaded => builtin::true, + fileName => $file, + emoji => { + name => $file =~ s/\..+$//r, + category => $opt->category, + localOnly => builtin::false, + isSensitive => builtin::false, + }, + }; +} + +path('meta.json')->spew_raw( + JSON::MaybeXS->new( + ascii => 1, + pretty => 0, + )->encode({ + metaVersion => 2, + emojis => \@emojis, + }), +); |