Skip to content

Commit 5044543

Browse files
Update build-ubuntu-rootfs.sh
Signed-off-by: Bjordis Collaku <[email protected]>
1 parent 5345c41 commit 5044543

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

rootfs/scripts/build-ubuntu-rootfs.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,14 @@ image_preproccessing_iot() {
179179

180180
echo "[INFO][iot][ubuntu] Downloading ISO..."
181181

182-
# Derive a sane ISO_NAME if not provided
183-
if [[ -z "$ISO_NAME" ]]; then
184-
ISO_NAME=$(basename "${IMG_URL%%\?*}")
182+
# SAFE under set -u:
183+
ISO_NAME="${ISO_NAME-}"
184+
if [[ -z "${ISO_NAME}" ]]; then
185+
if [[ -z "${IMG_URL-}" ]]; then
186+
echo "[ERROR] IMG_URL is empty/unset; cannot derive ISO_NAME."
187+
exit 1
188+
fi
189+
ISO_NAME="$(basename "${IMG_URL%%\?*}")"
185190
[[ -z "$ISO_NAME" || "$ISO_NAME" == "/" ]] && ISO_NAME="image.iso"
186191
fi
187192

0 commit comments

Comments
 (0)