diff --git a/parse-games b/parse-games index a78cf82..a467afd 100755 --- a/parse-games +++ b/parse-games @@ -27,13 +27,13 @@ function parse_tour_info { local tour_info=$(cat "${REPO_DIR}/${TOURNAMENT}/tours/${tour}/tour_info"; echo) local date_re="[0-9?]{2}\.[0-9?]{2}\.[0-9?]{4}" - local res_re="(1-0|½-½|0-1)" + local res_re="(1|½|0|\+|-)" while read line; do - if [[ $line =~ ^($date_re)\ +([^\ ]+)\ +-\ +([^\ ]+)(\ +$res_re)? ]]; then + if [[ $line =~ ^($date_re)\ +([^\ ]+)\ +-\ +([^\ ]+)(\ +$res_re-$res_re)? ]]; then local date=${BASH_REMATCH[1]} local white=${BASH_REMATCH[2]} local black=${BASH_REMATCH[3]} - local result=${BASH_REMATCH[5]} + local result=${BASH_REMATCH[5]}-${BASH_REMATCH[6]} local round=$(echo "($tour - 1)/($ply_count - 1) + 1" | bc) parse_to_ini ((game_counter += 1)) @@ -47,7 +47,7 @@ function parse_to_ini { [[ ! $date =~ \? ]] && echo "date = $date" echo "white = $white" echo "black = $black" - [[ -n $result ]] && echo "result = \"$result\"" + [[ $result == "-" ]] || echo "result = \"$result\"" echo }