sync-ebooks: Don't rename repository if target directory already exists

This commit is contained in:
Anthony J. Bentley 2023-02-16 21:23:16 -07:00 committed by Alex Cabal
parent 1e32a97c7d
commit 4ef06e6443

View file

@ -255,9 +255,15 @@ printf "%s\n" "${repoUrls}" | while IFS= read -r repoUrl; do
# if for some reason the repository name isn't the same as the identifier (they are identical
# 99% of the time), rename the directory to be the identifier name; not sure why this is done, either
if [ "${repoName}" != "${properName}" ]; then
if [ -d "${properName}" ]; then
if [ "${verbosity}" -gt 0 ]; then
printf "Not moving %s to %s: directory exists\n" "${repoName}" "${properName}"
fi
else
if [ "${verbosity}" -gt 0 ]; then
printf "Moving %s to %s\n" "${repoName}" "${properName}"
fi
mv "${repoName}" "${properName}"
fi
fi
done