Skip to content

Commit 76275d6

Browse files
ivanvcghouscht
authored andcommitted
release: properly change working dir if tmp location already exists
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 <[email protected]>
1 parent 4726460 commit 76275d6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/release.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,12 @@ main() {
8686
# Set up release directory.
8787
local reldir="/tmp/etcd-release-${VERSION}"
8888
log_callout "Preparing temporary directory: ${reldir}"
89-
if [ ! -d "${reldir}/etcd" ] && [ "${IN_PLACE}" == 0 ]; then
90-
mkdir -p "${reldir}"
91-
cd "${reldir}"
92-
run git clone "${REPOSITORY}" --branch "${BRANCH}" --depth 1
89+
if [ "${IN_PLACE}" == 0 ]; then
90+
if [ ! -d "${reldir}/etcd" ]; then
91+
mkdir -p "${reldir}"
92+
cd "${reldir}"
93+
run git clone "${REPOSITORY}" --branch "${BRANCH}" --depth 1
94+
fi
9395
run cd "${reldir}/etcd" || exit 2
9496
run git checkout "${BRANCH}" || exit 2
9597
run git pull origin

0 commit comments

Comments
 (0)