Script 'game-add': slight changes.
This commit is contained in:
parent
b7e57d97f7
commit
8a596606e9
8
game-add
8
game-add
@ -58,7 +58,7 @@ function game_check_args {
|
|||||||
# Don't add and clean up games simultaneously
|
# Don't add and clean up games simultaneously
|
||||||
$ADD_GAMES && $CLEANUP_GAMES && usage 1
|
$ADD_GAMES && $CLEANUP_GAMES && usage 1
|
||||||
# Check for duplicate URL
|
# Check for duplicate URL
|
||||||
local url_uniq=$(xargs -n1 <<< "$@" | sort -u | wc -l)
|
local url_uniq=$(xargs -n1 <<< $@ | sort -u | wc -l)
|
||||||
(( $# == $url_uniq )) || die "Game URLs not unique."
|
(( $# == $url_uniq )) || die "Game URLs not unique."
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ function game_tmp_pgns {
|
|||||||
|| die "Unreachable game PGN ${game_url}"
|
|| die "Unreachable game PGN ${game_url}"
|
||||||
done
|
done
|
||||||
|
|
||||||
$SORT_GAMES && TMP_PGN_FILES=( $(xargs -n1 <<< ${TMP_PGN_FILES[*]} | sort -n) )
|
$SORT_GAMES && TMP_PGN_FILES=( $(xargs -n1 <<< ${TMP_PGN_FILES[@]} | sort -n) )
|
||||||
}
|
}
|
||||||
|
|
||||||
function game_get_info {
|
function game_get_info {
|
||||||
@ -189,9 +189,9 @@ function game_parse_config {
|
|||||||
function game_add_player {
|
function game_add_player {
|
||||||
local lichess_ply=$1
|
local lichess_ply=$1
|
||||||
local ply=${NAMES[$lichess_ply]}
|
local ply=${NAMES[$lichess_ply]}
|
||||||
while [[ ! " ${NAMES[@]} " =~ \ $ply\ ]]; do
|
while [[ ! " ${NAMES[*]} " =~ \ $ply\ ]]; do
|
||||||
echo -n "$(tput setaf 2)The list of players:$(tput sgr0)"
|
echo -n "$(tput setaf 2)The list of players:$(tput sgr0)"
|
||||||
sed "s/ /\\"$'\n'"$(tput setaf 6)*$(tput sgr0) /g" <<< " ${NAMES[@]}"
|
sed "s/ /\\"$'\n'"$(tput setaf 6)*$(tput sgr0) /g" <<< " ${NAMES[*]}"
|
||||||
echo -n "Type the name of ${lichess_ply}> "
|
echo -n "Type the name of ${lichess_ply}> "
|
||||||
read ply
|
read ply
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user