data/wordlist.version.txt: force
@[ -e $@ ] || date -Is >$@
- @perl -ni -I. -MShiar_Sheet::DB -E 'say (Shiar_Sheet::DB->connect->select(word => "max(updated)", \["updated>?", $$_])->list or exit 1)' $@ || true
+ tools/lastword $@ || true
data/wordlist.inc.pl: tools/mkwordlist data/wordlist.version.txt
$(call cmdsave,$<)
$(call cmdsave,perl -MJSON -E "print JSON->new->utf8->canonical->encode(do \$$ARGV[0])" ./$<)
data/wordpairs.inc.pl: data/wordlist.version.txt
- @perl -I. -MShiar_Sheet::DB -MData::Dump=pp -E 'say pp(Shiar_Sheet::DB->connect->select("word w JOIN word a ON w.id=a.ref" => "w.id, a.id", {"a.lang"=>undef})->map or exit 1)' >$@
+ tools/wordpairs >$@
.SECONDARY: data/font/%.ttf
data/font/%.ttf:
--- /dev/null
+#!/usr/bin/env -S perl -ni
+use 5.014;
+use warnings;
+use lib '.';
+use Shiar_Sheet::DB;
+
+my $db = Shiar_Sheet::DB->connect;
+my $query = $db->select(word => 'max(updated)', \['updated > ?', $_]);
+say ($query->list or exit 1);
--- /dev/null
+#!/usr/bin/env perl
+use 5.014;
+use warnings;
+use lib '.';
+use Shiar_Sheet::DB;
+use Data::Dump 'pp';
+
+my $db = Shiar_Sheet::DB->connect;
+my $query = $db->select(
+ 'word w JOIN word a ON w.id = a.ref' => 'w.id, a.id',
+ {'a.lang' => undef}
+);
+say pp($query->map or exit 1);