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) <noreply@anthropic.com>
This commit is contained in:
Dorian 2026-03-25 17:03:21 +00:00
parent e88b759b52
commit b0ac506899

View File

@ -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 ""