diff --git a/tools/android_sdk/create_cipd_packages.sh b/tools/android_sdk/create_cipd_packages.sh index 8b6565b16eeda..2887cc1679f0f 100755 --- a/tools/android_sdk/create_cipd_packages.sh +++ b/tools/android_sdk/create_cipd_packages.sh @@ -6,7 +6,8 @@ print_usage () { echo "Usage:" echo " ./create_cipd_packages.sh [PATH_TO_SDK_DIR]" echo " Downloads, packages, and uploads Android SDK packages where:" - echo " - VERSION_TAG is the tag of the cipd packages, e.g. 28r6 or 31v1" + echo " - VERSION_TAG is the tag of the cipd packages, e.g. 28r6 or 31v1. Must contain" + echo " only lowercase letters and numbers." echo " - PATH_TO_SDK_DIR is the path to the sdk folder. If omitted, this defaults to" echo " your ANDROID_SDK_ROOT environment variable." echo " ./create_cipd_packages.sh list" @@ -31,6 +32,13 @@ if [[ $1 == "" ]]; then exit 1 fi +#Validate version contains only lower case letters and numbers +if ! [[ $1 =~ ^[[:lower:][:digit:]]+$ ]]; then + echo "Version tag can only consist of lower case letters and digits."; + print_usage + exit 1 +fi + # Validate path contains depot_tools if [[ `which cipd` == "" ]]; then echo "'cipd' command not found. depot_tools should be on the path."