From cb76ee9017bc4c8ee2e1ad067b73024d22819c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Seppo=20=C3=84yr=C3=A4v=C3=A4inen?= <25493530+sayravai@users.noreply.github.com> Date: Mon, 2 Mar 2026 15:17:39 +0200 Subject: [PATCH] Ask user to confirm before development data deletion --- docker-up.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docker-up.sh b/docker-up.sh index 0401fb3..bcf769f 100755 --- a/docker-up.sh +++ b/docker-up.sh @@ -48,15 +48,21 @@ onexit() { # and then stop containers. [ "$pid" ] && { pkill -SIGHUP -P $pid; docker compose stop; } || true wait + if [ -t 0 ]; then + stty sane + fi if [ "$keep" = "" ]; then - clean + echo + read -rp " Remove persistent data? [y/N] " confirm + if [[ "$confirm" =~ ^[Yy]$ ]]; then + clean + else + echo "Data was not removed. You can remove it with: $0 --clean" + fi else echo "Data was not removed. You can remove it with: $0 --clean" fi rm -rf /tmp/aplus || true - if [ -t 0 ]; then - stty sane - fi exit 0 }