Skip to content

Commit

Permalink
Merge pull request #18812 from ivanvc/fix-cwd-in-release-script
Browse files Browse the repository at this point in the history
release: properly change working dir if tmp location already exists
  • Loading branch information
ahrtr authored Nov 6, 2024
2 parents 22ce068 + 4763cb1 commit 7b70b5f
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 @@ -86,10 +86,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}"
run git clone "${REPOSITORY}" --branch "${BRANCH}" --depth 1
if [ "${IN_PLACE}" == 0 ]; then
if [ ! -d "${reldir}/etcd" ]; then
mkdir -p "${reldir}"
cd "${reldir}"
run git clone "${REPOSITORY}" --branch "${BRANCH}" --depth 1
fi
run cd "${reldir}/etcd" || exit 2
run git checkout "${BRANCH}" || exit 2
run git pull origin
Expand Down

0 comments on commit 7b70b5f

Please sign in to comment.