Modify a bit the format of 'tour_info'.
This commit is contained in:
parent
2b7fd48e9b
commit
e1dc86b638
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
Время проведения: 29.08.2014 - 07.09.2014
|
Время проведения: 29.08.2014 - 07.09.2014
|
||||||
|
|
||||||
??.??.???? dvvrd redgremlin
|
??.??.???? dvvrd - redgremlin
|
||||||
??.??.???? shell-script iVS
|
??.??.???? shell-script - iVS
|
||||||
??.??.???? Nedis Kakadu
|
??.??.???? Nedis - Kakadu
|
||||||
30.08.2014 aptyp Magian 0-1
|
30.08.2014 aptyp - Magian 0-1
|
||||||
??.??.???? MyTrooName HunOL
|
??.??.???? MyTrooName - HunOL
|
||||||
??.??.???? DoctorSinus J
|
??.??.???? DoctorSinus - J
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
|
|
||||||
Время проведения: 29.08.2014 - 07.09.2014
|
Время проведения: 29.08.2014 - 07.09.2014
|
||||||
|
|
||||||
??.??.???? redgremlin J
|
??.??.???? redgremlin - J
|
||||||
??.??.???? HunOL DoctorSinus
|
??.??.???? HunOL - DoctorSinus
|
||||||
??.??.???? Magian MyTrooName
|
??.??.???? Magian - MyTrooName
|
||||||
??.??.???? Kakadu aptyp
|
??.??.???? Kakadu - aptyp
|
||||||
??.??.???? iVS Nedis
|
??.??.???? iVS - Nedis
|
||||||
??.??.???? dvvrd shell-script
|
??.??.???? dvvrd - shell-script
|
||||||
|
4
game-add
4
game-add
@ -120,7 +120,7 @@ function game_add_to_repo {
|
|||||||
# Check if the tour number is correct
|
# Check if the tour number is correct
|
||||||
local correct=false length_max=0
|
local correct=false length_max=0
|
||||||
while IFS= read line; do
|
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
|
if [[ ${BASH_REMATCH[2]} == $white && ${BASH_REMATCH[3]} == $black ]]; then
|
||||||
correct=true
|
correct=true
|
||||||
local length_rec=${#BASH_REMATCH[1]}
|
local length_rec=${#BASH_REMATCH[1]}
|
||||||
@ -147,7 +147,7 @@ function game_add_to_repo {
|
|||||||
local spaces=$((length_max - length_rec + 1))
|
local spaces=$((length_max - length_rec + 1))
|
||||||
local sep=$(printf "%${spaces}s" " ")
|
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"
|
-i.orig "$tour_info"
|
||||||
rm "${tour_info}.orig"
|
rm "${tour_info}.orig"
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user