Skip to content

Commit 8104d3a

Browse files
committed
show-spring-boot-version-diff.sh: fix empty output under macOS High Sierra.
Correction for 3f9b59f commit.
1 parent fdf17bd commit 8104d3a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/scripts/show-spring-boot-version-diff.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ set -o pipefail
1111

1212
CURRENT_DIR="$(dirname "$0")"
1313
PROJECT_POM="$CURRENT_DIR/../../../pom.xml"
14-
SPRING_VERSION="$(grep -FA1 '<artifactId>spring-boot-starter-parent' "$PROJECT_POM" | sed -n '/<version>/s|.*>\([^<]\+\)<.*|\1|p')"
14+
SPRING_VERSION="$(grep -FA1 '<artifactId>spring-boot-starter-parent' "$PROJECT_POM" | awk -F'[<>]' '/<version>/{print $3}')"
1515
SPRING_POM="https://raw.githubusercontent.com/spring-projects/spring-boot/v$SPRING_VERSION/spring-boot-dependencies/pom.xml"
1616

1717
printf "Comparing with Spring Boot %s (project vs spring versions)\\n\\n" "$SPRING_VERSION"
1818

1919
# I know about useless cat below, but it's here for better readability.
2020
# shellcheck disable=SC2002
2121
join \
22-
<(cat "$PROJECT_POM" | sed -n '/\.version>/s|<\([^>]\+\)>\([^<]\+\)<.*|\1\t\2|p' | sort) \
23-
<(curl -s "$SPRING_POM" | sed -n '/\.version>/s|<\([^>]\+\)>\([^<]\+\)<.*|\1\t\2|p' | sort) \
22+
<(cat "$PROJECT_POM" | awk -F'[<>]' -v OFS='\t' '$2~/\.version/{print $2, $3}' | sort) \
23+
<(curl -s "$SPRING_POM" | awk -F'[<>]' -v OFS='\t' '$2~/\.version/{print $2, $3}' | sort) \
2424
| awk '
2525
{
2626
if ($2 != $3){

0 commit comments

Comments
 (0)