Skip to content

Commit

Permalink
make scripts work on mac and linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Ajay Kannan committed Apr 12, 2016
1 parent 1c9040f commit 884e33f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion utilities/update_docs_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/<version>[0-9]+\.[0-9]+\.[0-9]+<\/version>/<version>${RELEASED_VERSION}<\/version>/g" ${item}/README.md
Expand Down
2 changes: 1 addition & 1 deletion utilities/update_pom_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 884e33f

Please sign in to comment.