Add case checking to android sdk cipd upload script (flutter/engine#45063)
See https://github.com/flutter/flutter/pull/131901#issuecomment-1690252455 for the reason for this PR. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This commit is contained in:
@@ -6,7 +6,8 @@ print_usage () {
|
||||
echo "Usage:"
|
||||
echo " ./create_cipd_packages.sh <VERSION_TAG> [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."
|
||||
|
||||
Reference in New Issue
Block a user