Modify a bit the format of 'tour_info'.

This commit is contained in:
vonavi 2014-08-31 11:28:56 +04:00
parent 2b7fd48e9b
commit e1dc86b638
3 changed files with 14 additions and 14 deletions

View File

@ -3,9 +3,9 @@
Время проведения: 29.08.2014 - 07.09.2014
??.??.???? dvvrd redgremlin
??.??.???? shell-script iVS
??.??.???? Nedis Kakadu
30.08.2014 aptyp Magian 0-1
??.??.???? MyTrooName HunOL
??.??.???? DoctorSinus J
??.??.???? dvvrd - redgremlin
??.??.???? shell-script - iVS
??.??.???? Nedis - Kakadu
30.08.2014 aptyp - Magian 0-1
??.??.???? MyTrooName - HunOL
??.??.???? DoctorSinus - J

View File

@ -3,9 +3,9 @@
Время проведения: 29.08.2014 - 07.09.2014
??.??.???? redgremlin J
??.??.???? HunOL DoctorSinus
??.??.???? Magian MyTrooName
??.??.???? Kakadu aptyp
??.??.???? iVS Nedis
??.??.???? dvvrd shell-script
??.??.???? redgremlin - J
??.??.???? HunOL - DoctorSinus
??.??.???? Magian - MyTrooName
??.??.???? Kakadu - aptyp
??.??.???? iVS - Nedis
??.??.???? dvvrd - shell-script

View File

@ -120,7 +120,7 @@ function game_add_to_repo {
# Check if the tour number is correct
local correct=false length_max=0
while IFS= read line; do
if [[ $line =~ ^(${date_re}\ +([^\ ]+)\ +([^\ ]+)) ]]; then
if [[ $line =~ ^(${date_re}\ +([^\ ]+)\ +-\ +([^\ ]+)) ]]; then
if [[ ${BASH_REMATCH[2]} == $white && ${BASH_REMATCH[3]} == $black ]]; then
correct=true
local length_rec=${#BASH_REMATCH[1]}
@ -147,7 +147,7 @@ function game_add_to_repo {
local spaces=$((length_max - length_rec + 1))
local sep=$(printf "%${spaces}s" " ")
sed -E "s/${date_re}( +${white} +${black})/${game_date}\1${sep}${result}/g" \
sed -E "s/${date_re}( +${white} +- +${black})/${game_date}\1${sep}${result}/g" \
-i.orig "$tour_info"
rm "${tour_info}.orig"
}