From a40a96e662287b592f8e734016fb5693d4ae2007 Mon Sep 17 00:00:00 2001 From: Slawomir Koszewski Date: Mon, 15 Dec 2025 08:17:58 +0100 Subject: [PATCH] Added a prompt to create a volume for an unknown account. --- azure-cli | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/azure-cli b/azure-cli index 66c3a7d..43f6611 100755 --- a/azure-cli +++ b/azure-cli @@ -76,6 +76,12 @@ fi # Check, if the account volume exists, if not create it # This ensures persistent storage for the Azure CLI configuration if ! $CMD volume inspect "account_$SANITIZED_ACCOUNT_NAME" &> /dev/null; then + echo "A volume for account '$ACCOUNT_NAME' does not exist." + read -p "Would you like to create one? (y/n) " -r RESPONSE + if [[ ! "$RESPONSE" =~ ^[Yy]$ ]]; then + echo "Aborting." + exit 1 + fi echo "Creating volume account_$SANITIZED_ACCOUNT_NAME for Azure CLI configuration." if ! $CMD volume create "account_$SANITIZED_ACCOUNT_NAME" --label "account=$ACCOUNT_NAME" &> /dev/null; then echo "Error: Failed to create volume account_$SANITIZED_ACCOUNT_NAME." >&2