Script 'schedule': remove a trailing slash by 'sed'.

This commit is contained in:
vonavi 2014-11-28 16:59:31 +03:00
parent 4f2aa7d50c
commit 42167effaa

View File

@ -75,9 +75,7 @@ function setup_repo {
if [[ -z $TOURNAMENT ]]; then if [[ -z $TOURNAMENT ]]; then
local year_dir=$(ls -1 -d ${REPO_DIR}/[0-9][0-9][0-9][0-9]/ | tail -1) 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 \ TOURNAMENT=$(ls -1 -d ${year_dir}[0-9]-*/ | tail -1 \
| sed -E "s|${REPO_DIR}/(.*)|\1|") | sed -E "s|${REPO_DIR}/(.*)/|\1|")
# Remove the trailing slash
TOURNAMENT=${TOURNAMENT%/}
fi fi
fi fi
} }