From 4bfd85ffbf925035828e79b69dec1b6fb0235ac8 Mon Sep 17 00:00:00 2001 From: "Anthony J. Bentley" Date: Thu, 16 Feb 2023 22:49:02 -0700 Subject: [PATCH] Check truncated repo names properly even when they end in .git --- scripts/sync-ebooks | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/sync-ebooks b/scripts/sync-ebooks index 911c36d2..9d90ec6a 100755 --- a/scripts/sync-ebooks +++ b/scripts/sync-ebooks @@ -215,9 +215,9 @@ printf "%s\n" "${repoUrls}" | while IFS= read -r repoUrl; do # if the repository name has been truncated due to GitHub's name length limits, # but a local clone with the full name exists, don't attempt to clone it again - repoNameLength=$(printf "%s" "${repoName}" | wc -m) + repoNameLength=$(printf "%s" "${repoName%.git}" | wc -m) if [ "${repoNameLength}" -ge 100 ]; then - if dirs=( "${repoName}"*/ ) && [[ -d ${dirs[0]} ]]; then + if dirs=( "${repoName%.git}"*/ ) && [[ -d ${dirs[0]} ]]; then continue fi fi