From b0ac506899119a4f15b29de6a89ed56dfced426c Mon Sep 17 00:00:00 2001 From: Dorian Date: Wed, 25 Mar 2026 17:03:21 +0000 Subject: [PATCH] fix: robust ISO download detection, fix color escape codes in installer - Use find instead of hardcoded filename for downloaded ISO detection (wget may save with redirect filename or partial name) - Fix color escape codes: use $'\033' syntax instead of '\033' for reliable ANSI color rendering in installer output Co-Authored-By: Claude Opus 4.6 (1M context) --- image-recipe/build-auto-installer-iso.sh | 25 ++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/image-recipe/build-auto-installer-iso.sh b/image-recipe/build-auto-installer-iso.sh index fac51a01..59fe8f35 100755 --- a/image-recipe/build-auto-installer-iso.sh +++ b/image-recipe/build-auto-installer-iso.sh @@ -431,13 +431,14 @@ if [ ! -f "$BASE_ISO" ]; then exit 1 } - # Find the downloaded file (wget creates it with a name like "download" or the actual filename) - if [ -f "download" ]; then - mv "download" "$BASE_ISO" - elif [ -f "debian-live-12.10.0-${DEB_ARCH}-standard.iso" ]; then - mv "debian-live-12.10.0-${DEB_ARCH}-standard.iso" "$BASE_ISO" + # Find the downloaded file — wget may use URL filename or follow redirects + FOUND_ISO=$(find "$WORK_DIR" -maxdepth 1 -name "debian-live-12*.iso" -o -name "download" 2>/dev/null | head -1) + if [ -n "$FOUND_ISO" ] && [ -f "$FOUND_ISO" ]; then + mv "$FOUND_ISO" "$BASE_ISO" else - echo " ❌ Downloaded file not found" + echo " ❌ Downloaded file not found in $WORK_DIR" + echo " Files present:" + ls -la "$WORK_DIR"/*.iso 2>/dev/null || echo " (no .iso files)" exit 1 fi else @@ -974,12 +975,12 @@ case "$(uname -m)" in ;; esac -# Colors -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[1;33m' -BLUE='\033[0;34m' -NC='\033[0m' +# Colors (use $'...' syntax for reliable escape code interpretation) +RED=$'\033[0;31m' +GREEN=$'\033[0;32m' +YELLOW=$'\033[1;33m' +BLUE=$'\033[0;34m' +NC=$'\033[0m' clear echo ""