diff options
| author | Craig Jennings <c@cjennings.net> | 2026-01-19 11:27:38 -0600 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-01-19 11:27:38 -0600 |
| commit | f4c5f04c8c41d895dfd10eb0cecda76a0bc58d45 (patch) | |
| tree | 09093a31191206ae2a2d32b60c7c12ddaba5bab0 /scripts/build-release | |
| parent | 51ae4bdcbc6c4280520d01da85dba729974b2a7b (diff) | |
| download | archangel-f4c5f04c8c41d895dfd10eb0cecda76a0bc58d45.tar.gz archangel-f4c5f04c8c41d895dfd10eb0cecda76a0bc58d45.zip | |
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.
Diffstat (limited to 'scripts/build-release')
| -rwxr-xr-x | scripts/build-release | 21 |
1 files changed, 14 insertions, 7 deletions
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 |
