Skip to content

Commit

Permalink
release: properly change working dir if tmp location already exists
Browse files Browse the repository at this point in the history
Backport pull request etcd-io#18812.

Signed-off-by: Ivan Valdes <[email protected]>
  • Loading branch information
ivanvc committed Nov 11, 2024
1 parent c4d1505 commit bd959e7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bd959e7

Please sign in to comment.