# HG changeset patch # User Arne Babenhauserheide # Date 1575755119 -3600 # Sat Dec 07 22:45:19 2019 +0100 # Node ID e4a304029ef6f51f2cda4aad709cbacff079fd36 # Parent d8a1a0e2b62ac182c3facb5af4e2be48c957f6cd Ask for a new name if the name is forbidden diff --git a/invertbucket b/invertbucket --- a/invertbucket +++ b/invertbucket @@ -314,7 +314,16 @@ then printf "Failed to create %s repository:\n" "$host" >&2 printf '%s' "$resp" | jq . >&2 - return 1 + if echo "$resp" | grep -q "Name must match"; then + echo 'Please choose a new name that matches the requirements:' + read -r name + # repeating the request with the new name + resp=$(srhtreq POST "$url" \ + -H "Content-Type: application/json" \ + -d'{"name": "'"$name"'", "visibility": "'$visibility'", "description": '"$desc"'}') + else + return 1 + fi fi srht_name=$(jqget "$resp" .name) srht_owner=$(jqget "$resp" .owner.canonical_name)