From 62107e4f24203b6f5607bb6cb5e40fe85c5beaae Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 19 Jan 2026 11:27:38 -0600 Subject: Add --yes flag for fully automated distribution New --yes/-y flag skips the dd confirmation prompt, allowing build-release to run completely unattended for CI/CD workflows. The ARCHZFS label on the drive is sufficient safety - if it has that label, it was created by this process and is the intended target. --- scripts/build-release | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'scripts') diff --git a/scripts/build-release b/scripts/build-release index c5ec921..00f66ce 100755 --- a/scripts/build-release +++ b/scripts/build-release @@ -46,16 +46,19 @@ step() { echo -e "\n${CYAN}=== $1 ===${NC}\n"; } # Parse arguments SKIP_BUILD=false SKIP_TEST=false +AUTO_CONFIRM=false while [[ $# -gt 0 ]]; do case $1 in --skip-build) SKIP_BUILD=true; shift ;; --skip-test) SKIP_TEST=true; shift ;; + --yes|-y) AUTO_CONFIRM=true; shift ;; -h|--help) - echo "Usage: $0 [--skip-build] [--skip-test]" + echo "Usage: $0 [--skip-build] [--skip-test] [--yes]" echo "" echo "Options:" echo " --skip-build Skip ISO build, distribute existing ISO" echo " --skip-test Skip QEMU sanity test" + echo " --yes, -y Auto-confirm dd to ARCHZFS drive (no prompt)" exit 0 ;; *) error "Unknown option: $1" ;; @@ -234,17 +237,21 @@ distribute_archzfs_usb() { return 0 fi - # Confirm before writing + # Confirm before writing (unless --yes flag) echo "" warn "About to write ISO to $ARCHZFS_DISK" - warn "This will ERASE ALL DATA on the drive!" lsblk "$ARCHZFS_DISK" echo "" - read -p "Type 'yes' to confirm: " confirm - if [[ "$confirm" != "yes" ]]; then - warn "Skipping USB write" - return 0 + if ! $AUTO_CONFIRM; then + warn "This will ERASE ALL DATA on the drive!" + read -p "Type 'yes' to confirm: " confirm + if [[ "$confirm" != "yes" ]]; then + warn "Skipping USB write" + return 0 + fi + else + info "Auto-confirmed (--yes flag)" fi # Unmount any mounted partitions -- cgit v1.2.3