From bd959e7827717f9d02e188a776109303ebfcc272 Mon Sep 17 00:00:00 2001 From: Ivan Valdes Date: Mon, 11 Nov 2024 15:47:31 -0700 Subject: [PATCH] release: properly change working dir if tmp location already exists Backport pull request #18812. Signed-off-by: Ivan Valdes --- scripts/release.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/release.sh b/scripts/release.sh index 603c628b696..93f70b2cb49 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -62,10 +62,12 @@ main() { # Set up release directory. local reldir="/tmp/etcd-release-${VERSION}" log_callout "Preparing temporary directory: ${reldir}" - if [ ! -d "${reldir}/etcd" ] && [ "${IN_PLACE}" == 0 ]; then - mkdir -p "${reldir}" - cd "${reldir}" - git clone "${REPOSITORY}" --branch "${BRANCH}" --depth 1 + if [ "${IN_PLACE}" == 0 ]; then + if [ ! -d "${reldir}/etcd" ]; then + mkdir -p "${reldir}" + cd "${reldir}" + git clone "${REPOSITORY}" --branch "${BRANCH}" --depth 1 + fi cd "${reldir}/etcd" || exit 2 git checkout "${BRANCH}" || exit 2 git pull origin