From dc2476b207283b23e371358de5374b53423ebce5 Mon Sep 17 00:00:00 2001 From: tateisu Date: Thu, 25 Jun 2020 03:50:07 +0900 Subject: [PATCH] update checkMissingTranslation.pl --- checkMissingTranslation.pl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/checkMissingTranslation.pl b/checkMissingTranslation.pl index 631f56eb..26ef94ee 100644 --- a/checkMissingTranslation.pl +++ b/checkMissingTranslation.pl @@ -28,7 +28,7 @@ open(my $fh,"-|","git status --porcelain --branch") my @untrackedFiles; while(<$fh>){ - chomp; + s/[\x0d\x0a]+//; if(/^\?\?\s*(\S+)/){ my $path =$1; next if $path =~ /\.idea|_Emoji/; @@ -36,8 +36,8 @@ while(<$fh>){ }elsif( /^##\s*(\S+?)(?:\.\.|$)/ ){ my $branch=$1; print "# branch=$branch\n"; - $branch eq 'master' - or warn "!!!! current branch is not master !!!!\n"; + $branch eq 'trunk' + or warn "!!!! current branch is not trunk !!!!\n"; # }else{ # warn "working tree is not clean.\n"; # cmd "git status"; @@ -56,7 +56,7 @@ close($fh) my $xml = XML::Simple->new; -my $master_name = "_master"; +my $default_name = "_default"; my @files; @@ -73,7 +73,7 @@ for my $file(@files){ if( $file =~ m|values-([^/]+)| ){ $lang = $1; }else{ - $lang=$master_name; + $lang=$default_name; } my $data = $xml->XMLin($file); if( not $data->{string} or ($data->{string}{content} and not ref $data->{string}{content} )){ @@ -94,7 +94,7 @@ for my $file(@files){ my $hasError = 0; -my $master = $langs{ $master_name }; +my $master = $langs{ $default_name }; $master or die "missing master languages.\n"; my %params; while(my($name,$value)=each %$master){ @@ -147,8 +147,9 @@ $hasError and die "please fix error(s).\n"; # Weblateの未マージのブランチがあるか調べる system qq(git fetch weblate -q); -my @list = `git branch -a --no-merged`; +my @list = `git branch --no-merged`; for(@list){ + s/[\x0d\x0a]+//; print "# Unmerged branch: $_\n"; }