From fb617185df14b4907edf9382e737d2bbca31a733 Mon Sep 17 00:00:00 2001 From: The_miro Date: Fri, 26 Jun 2026 18:52:31 +0200 Subject: [PATCH] chore(installer): shellcheck-clean the archiso answerfile flow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit shellcheck passes (default severity) on the base installer and the whole answerfile chain: generate-answerfile.sh → build.sh → .automated_script.sh → launch.sh → arch-autoinstall.sh → tui-install.sh. Verified the generator's JSON schema (drive, kernel, keymap, hostname, username, encrypt, fido2_root, fido2_user, run_tui, components, desktop_environment, apps, shell_rc, colors) parses correctly through both the auto base installer (af_get/af_bool) and the TUI installer (load_answerfile), for full and minimal/empty answerfiles. Fixed the three legitimate findings surfaced along the way: - generate-answerfile.sh: drop unused AVAIL_DRIVES (SC2034); the drive list is rendered inline in the dialog prompt. - tui-install.sh: drop unused C_RULE (SC2034); write log truncation as ': > "$LOG"' so the redirection has an explicit command (SC2188). Co-Authored-By: Claude Opus 4.8 --- setup/generate-answerfile.sh | 4 ++-- setup/tui-install.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup/generate-answerfile.sh b/setup/generate-answerfile.sh index 96315e8..e6d3665 100644 --- a/setup/generate-answerfile.sh +++ b/setup/generate-answerfile.sh @@ -101,8 +101,8 @@ dialog --backtitle "$BACKTITLE" \ # ═══════════════════════════════════════════════════════════════ # ── Drive ───────────────────────────────────────────────────────────────────── -AVAIL_DRIVES=$(lsblk -dn -o NAME,SIZE,MODEL 2>/dev/null | awk '{printf "%s \"%s %s\" off ", $1, $2, $3}' || true) - +# The available-drives list is rendered inline in the inputbox prompt below via +# lsblk, so no separate variable is needed here. AF_DRIVE=$(dialog --backtitle "$BACKTITLE" \ --title " Target Drive " \ --inputbox "\n Enter the install drive (e.g. /dev/sda, /dev/nvme0n1).\n\n Available drives:\n$(lsblk -dn -o NAME,SIZE,MODEL 2>/dev/null | sed 's/^/ /')\n" \ diff --git a/setup/tui-install.sh b/setup/tui-install.sh index 61c1217..aa93319 100755 --- a/setup/tui-install.sh +++ b/setup/tui-install.sh @@ -37,7 +37,6 @@ ANSWERFILE_MODE=false # tput is not used here because it may be unavailable on a minimal TTY. C_RESET=$'\033[0m' C_TITLE=$'\033[1;35m' # bold magenta — section headers -C_RULE=$'\033[35m' # magenta — separators C_ACCENT=$'\033[36m' # cyan — prompts and selected marks C_BOLD=$'\033[1m' C_DIM=$'\033[2m' @@ -461,7 +460,8 @@ fi # Truncate the log file now that preflight passed; all prior output was to stdout. # Entries appended from this point on are the authoritative install log. -> "$LOG" +# ':' is the no-op command so the redirection has an explicit target. +: > "$LOG" printf "Dotfiles install: %s\nDotfiles dir: %s\n" "$(date)" "$DOTFILES_DIR" >> "$LOG" # ── Welcome ───────────────────────────────────────────────────────────────────