From 19b95e707d5cdcf7b64c80abc060d01f23325dc8 Mon Sep 17 00:00:00 2001 From: yukkop Date: Tue, 5 May 2026 20:19:52 +0000 Subject: [PATCH] feat: `deploy`: 1 no tty option --- package/deploy/deploy.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/package/deploy/deploy.sh b/package/deploy/deploy.sh index 4a52b49..4990a12 100644 --- a/package/deploy/deploy.sh +++ b/package/deploy/deploy.sh @@ -61,6 +61,10 @@ while [ $# -gt 0 ]; do target_host=$2 shift 2 ;; + -y|--yes) + assume_yes=1 + shift + ;; --) shift break @@ -187,10 +191,14 @@ if [ "${push_deploy+x}" ]; then if [ "${server_init+x}" ]; then if [ "$is_target_host_nixos" -eq 1 ]; then log warn 'target host already is nixos, are you really want to reinstall nixos?' - printf 'This may delete all data [y/N]\n' - read -r CONTINUE - if [ "$CONTINUE" != "y" ]; then - exit 0 + if [ "${assume_yes+x}" ]; then + log info 'assuming yes (-y/--yes), proceeding with reinstall' + else + printf 'This may delete all data [y/N]\n' + read -r CONTINUE + if [ "$CONTINUE" != "y" ]; then + exit 0 + fi fi fi