Skip to content

Commit

Permalink
* Sort the resulting pack row files
Browse files Browse the repository at this point in the history
  • Loading branch information
audreyt committed Jul 10, 2014
1 parent 0523d37 commit 40f1791
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions link2pack.pl
Expand Up @@ -33,17 +33,14 @@
unless (-e "$lang/$file.json" and read_file("$lang/$file.json") eq $_) {
write_file("$lang/$file.json", $_);
}
if ($prepack{$bucket}) {
$prepack{$bucket} .= qq<\n,"$title":$_>
}
else {
$prepack{$bucket} = qq<{"$title":$_>;
}
push @{ $prepack{$bucket} }, qq<\n,"$title":$_>;
}

mkdir "p${lang}ck" unless -e "p${lang}ck";
mkdir "ios/www/p${lang}ck" unless -e "ios/www/p${lang}ck";
while (my ($k, $v) = each %prepack) {
$v = join '', sort @$v;
$v =~ s/\n,/{/;
$v .= "\n}\n";
write_file("p${lang}ck/$k.txt", $v);
}
Expand Down

0 comments on commit 40f1791

Please sign in to comment.