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
Currently, the script won't change directories into the previously
cloned repository if the temporary location exists. This may be an issue
when testing first with a dry run and later with the actual release.

Signed-off-by: Ivan Valdes <ivan@vald.es>
  • Loading branch information
ivanvc committed Oct 30, 2024
1 parent 6883308 commit 4763cb1
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 4763cb1

Please sign in to comment.