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 <ivan@vald.es>
This commit is contained in:
parent
6883308899
commit
4763cb10f0
@ -86,10 +86,12 @@ main() {
|
|||||||
# Set up release directory.
|
# Set up release directory.
|
||||||
local reldir="/tmp/etcd-release-${VERSION}"
|
local reldir="/tmp/etcd-release-${VERSION}"
|
||||||
log_callout "Preparing temporary directory: ${reldir}"
|
log_callout "Preparing temporary directory: ${reldir}"
|
||||||
if [ ! -d "${reldir}/etcd" ] && [ "${IN_PLACE}" == 0 ]; then
|
if [ "${IN_PLACE}" == 0 ]; then
|
||||||
mkdir -p "${reldir}"
|
if [ ! -d "${reldir}/etcd" ]; then
|
||||||
cd "${reldir}"
|
mkdir -p "${reldir}"
|
||||||
run git clone "${REPOSITORY}" --branch "${BRANCH}" --depth 1
|
cd "${reldir}"
|
||||||
|
run git clone "${REPOSITORY}" --branch "${BRANCH}" --depth 1
|
||||||
|
fi
|
||||||
run cd "${reldir}/etcd" || exit 2
|
run cd "${reldir}/etcd" || exit 2
|
||||||
run git checkout "${BRANCH}" || exit 2
|
run git checkout "${BRANCH}" || exit 2
|
||||||
run git pull origin
|
run git pull origin
|
||||||
|
Loading…
Reference in New Issue
Block a user