Added a prompt to create a volume for an unknown account.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user