diff --git a/utilities/update_docs_version.sh b/utilities/update_docs_version.sh index 0dcd38a2318a..4d7c82c6ac70 100755 --- a/utilities/update_docs_version.sh +++ b/utilities/update_docs_version.sh @@ -10,7 +10,7 @@ RELEASED_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate if [ "${RELEASED_VERSION##*-}" != "SNAPSHOT" ]; then echo "Changing version to $RELEASED_VERSION in README files" # Get list of directories for which README.md must be updated - module_folders=($(find . -maxdepth 2 \( -regex "./gcloud-java[-[a-z]+]+*" -o -regex "./gcloud-java-contrib/gcloud-java[-[a-z]+]+*" \) -type d) . ./gcloud-java) + module_folders=($(find . -maxdepth 2 -type d | sed -E -n "/^(\.|\.\/gcloud-java-contrib)\/gcloud-java(-[a-z]+)+$/p") . ./gcloud-java) for item in ${module_folders[*]} do sed -ri "s/[0-9]+\.[0-9]+\.[0-9]+<\/version>/${RELEASED_VERSION}<\/version>/g" ${item}/README.md diff --git a/utilities/update_pom_version.sh b/utilities/update_pom_version.sh index 0dbd58e0f39e..155502d78898 100755 --- a/utilities/update_pom_version.sh +++ b/utilities/update_pom_version.sh @@ -11,7 +11,7 @@ # Get the previous maven project version. CURRENT_VERSION=$(mvn org.apache.maven.plugins:maven-help-plugin:2.1.1:evaluate -Dexpression=project.version | grep -Ev '(^\[|\w+:)') # Get list of directories for which pom.xml must be updated -module_folders=($(find . -maxdepth 2 \( -regex "./gcloud-java[-[a-z]+]+*" -o -regex "./gcloud-java-contrib/gcloud-java[-[a-z]+]+*" \) -type d) . ./gcloud-java) +module_folders=($(find . -maxdepth 2 -type d | sed -E -n "/^(\.|\.\/gcloud-java-contrib)\/gcloud-java(-[a-z]+)+$/p") . ./gcloud-java) if [ $# -eq 1 ]; then NEW_VERSION=$1 elif [ "${CURRENT_VERSION##*-}" != "SNAPSHOT" ]; then