From 93a3000d28f6b830fb92e6684d470a02f4d6ceb7 Mon Sep 17 00:00:00 2001 From: naskya Date: Fri, 27 Oct 2023 23:05:57 +0900 Subject: [PATCH] dev: add --no-confirm option to update.sh --- update.sh | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/update.sh b/update.sh index 19bb5a0e..f6705114 100755 --- a/update.sh +++ b/update.sh @@ -14,17 +14,21 @@ function running { } say "Start upgrading Firefish!" -say "Did you stop your server?" -read -r -p "[Y/n] > " yn -case "${yn}" in - [Nn]|[Nn][Oo]) - say "You must stop your server first!" - exit 1 - ;; - *) - say "uwu~ erai erai!\n" - ;; -esac + +# Confirm that the server is stopped +if [[ $# != 1 ]] || [[ $1 != "--no-confirm" ]]; then + say "Did you stop your server?" + read -r -p "[Y/n] > " yn + case "${yn}" in + [Nn]|[Nn][Oo]) + say "You must stop your server first!" + exit 1 + ;; + *) + say "uwu~ erai erai!\n" + ;; + esac +fi # Pull changes ## git pull