Skip to content

Commit 1db172d

Browse files
committed
fix(joomengine): replace [continue] with [return] in image processing loop
- Ensure proper function exit behavior for early returns - Correct variable casing in [while] loop to avoid potential errors
1 parent b556d40 commit 1db172d

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/bin/joomengine.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ build_image() {
596596
local LINE="$1"
597597

598598
# Skip empty lines
599-
[[ -z "$LINE" ]] && continue
599+
[[ -z "$LINE" ]] && return 0
600600

601601
# Parse required fields
602602
read -r IMAGE CONTEXT_PATH BASE_TAG < <(
@@ -612,15 +612,15 @@ build_image() {
612612
if docker image inspect "$FULL_BASE_IMAGE" >/dev/null 2>&1; then
613613
echo " ↪ Image already exists, skipping build: $FULL_BASE_IMAGE"
614614
BUILT_IMAGES["$FULL_BASE_IMAGE"]=1
615-
continue
615+
return 0
616616
fi
617617

618618
# --------------------------------------------------
619619
# SOFT SKIP: Already built earlier in this run
620620
# --------------------------------------------------
621621
if [[ -n "${BUILT_IMAGES[$FULL_BASE_IMAGE]:-}" ]]; then
622622
echo " ↪ Skipping already-built (this run) $FULL_BASE_IMAGE"
623-
continue
623+
return 0
624624
fi
625625

626626
echo
@@ -683,7 +683,7 @@ done < "$BUILD_MANIFEST_FILE"
683683
# --------------------------------------------------
684684
# build the latest image (last)
685685
# --------------------------------------------------
686-
while IFS= read -r LINE || [[ -n "$line" ]]; do
686+
while IFS= read -r line || [[ -n "$line" ]]; do
687687
[[ -z "$line" ]] && continue
688688

689689
latest=$(echo "$line" | jq -r '.latest')
@@ -701,5 +701,3 @@ if [[ "$DRY_RUN" == "no" ]] && [[ "$BUILD_ONLY" == "no" ]]; then
701701
else
702702
echo "ℹ️ Push skipped (dry-run or build-only)"
703703
fi
704-
705-

0 commit comments

Comments
 (0)