build_image: Allow building sysexts for an existing image

by skipping the check for an existing image directory if we're not
building an image. This makes './build_image sysext' work.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
This commit is contained in:
Jeremi Piotrowski 2024-03-06 13:07:35 +00:00
parent 5d5dd59102
commit 1bb108e326

View File

@ -126,7 +126,7 @@ if [[ ${skip_test_build_root} -ne 1 ]]; then
fi
# Handle existing directory.
if [[ -e "${BUILD_DIR}" ]]; then
if [[ -e "${BUILD_DIR}" ]] && [[ "${PROD_IMAGE}" = 1 ]]; then
if [[ ${FLAGS_replace} -eq ${FLAGS_TRUE} ]]; then
sudo rm -rf "${BUILD_DIR}"
else