Script 'game-add': remove a trailing slash by 'sed'.

This commit is contained in:
vonavi 2014-11-28 16:57:17 +03:00
parent 52cb416ad8
commit 8e5a56a653

View File

@ -55,9 +55,7 @@ function game_setup {
if [[ -z $TOURNAMENT ]]; then
local year_dir=$(ls -1 -d ${REPO_DIR}/[0-9][0-9][0-9][0-9]/ | tail -1)
TOURNAMENT=$(ls -1 -d ${year_dir}[0-9]-*/ | tail -1 \
| sed -E "s|${REPO_DIR}/(.*)|\1|")
# Remove the trailing slash
TOURNAMENT=${TOURNAMENT%/}
| sed -E "s|${REPO_DIR}/(.*)/|\1|")
fi
# Configuration file for players