chore: simplified awk usage for version extraction (#5893)

This commit is contained in:
Phred Lane 2024-09-27 02:59:31 -05:00 committed by GitHub
parent c9116aac88
commit dd646d7b7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 4 deletions

View file

@ -75,7 +75,10 @@ new tool needs in the `PATH`, and the expected version command:
`build.gradle`. Example: `build.gradle`. Example:
```sh ```sh
GOOGLE_JAVA_FORMAT_VERSION="$(grep <"google-java-format/build.gradle" "google-java-format" | awk -F ':' '{print $3}' | tr -d "'")" GOOGLE_JAVA_FORMAT_VERSION="$(
set -euo pipefail
awk -F "[:']" '/google-java-format/ {print $4}' "google-java-format/build.gradle"
)"
``` ```
6. Add the new to DependaBot configuration: 6. Add the new to DependaBot configuration:

View file

@ -4,7 +4,7 @@ set -euo pipefail
CHECKSTYLE_VERSION="$( CHECKSTYLE_VERSION="$(
set -euo pipefail set -euo pipefail
grep <"checkstyle/build.gradle" "checkstyle" | awk -F ':' '{print $3}' | tr -d "'" awk -F "[:']" '/checkstyle/ {print $4}' "checkstyle/build.gradle"
)" )"
echo "Installing Checkstyle: ${CHECKSTYLE_VERSION}" echo "Installing Checkstyle: ${CHECKSTYLE_VERSION}"

View file

@ -4,7 +4,7 @@ set -euo pipefail
GOOGLE_JAVA_FORMAT_VERSION="$( GOOGLE_JAVA_FORMAT_VERSION="$(
set -euo pipefail set -euo pipefail
grep <"google-java-format/build.gradle" "google-java-format" | awk -F ':' '{print $3}' | tr -d "'" awk -F "[:']" '/google-java-format/ {print $4}' "google-java-format/build.gradle"
)" )"
echo "Installing Google Java Format: ${GOOGLE_JAVA_FORMAT_VERSION}" echo "Installing Google Java Format: ${GOOGLE_JAVA_FORMAT_VERSION}"

View file

@ -4,7 +4,7 @@ set -euo pipefail
KTLINT_VERSION="$( KTLINT_VERSION="$(
set -euo pipefail set -euo pipefail
grep <"ktlint/build.gradle" "ktlint" | awk -F ':' '{print $3}' | tr -d "'" awk -F "[:']" '/ktlint/ {print $4}' "ktlint/build.gradle"
)" )"
echo "Installing Ktlint: ${KTLINT_VERSION}" echo "Installing Ktlint: ${KTLINT_VERSION}"