Postprocessing for crowdin: cleanup PO-Revision-Date: from .po files

This commit is contained in:
Alexey Sokolov
2017-12-21 03:09:33 +00:00
parent 0d14d725a3
commit 1b90903cb2
2 changed files with 18 additions and 0 deletions

View File

@@ -38,6 +38,8 @@ timestamps {
sh "$crowdin_cli download --branch ${upstream_branch}"
}
}
sh 'find . -name "*.po" -exec msgfilter -i "{}" -o "{}.replacement" .ci/cleanup-po.pl ";"'
sh 'find . -name "*.po" -exec mv "{}.replacement" "{}" ";"'
}
stage('Push') {
sh 'git config user.name "ZNC-Jenkins"'

16
.ci/cleanup-po.pl Executable file
View File

@@ -0,0 +1,16 @@
#!/usr/bin/env perl
use strict;
use warnings;
use v5.10;
local $/;
my $text = <>;
if ($ENV{MSGFILTER_MSGID}) {
print $text;
} else {
for (split(/^/, $text)) {
print unless /^PO-Revision-Date:/;
}
}