From 66eb8a1b4eca82028aa87d5265a680d8203b4dab Mon Sep 17 00:00:00 2001 From: aireilly Date: Wed, 11 Oct 2023 11:48:27 +0100 Subject: [PATCH] Fixing get-updated-distros.sh --- scripts/get-updated-distros.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/get-updated-distros.sh b/scripts/get-updated-distros.sh index 938b4df7ff..bbdc28b317 100755 --- a/scripts/get-updated-distros.sh +++ b/scripts/get-updated-distros.sh @@ -3,9 +3,17 @@ # Returns a list of updated _topic_map.yml files. # The list includes any topic maps that are themselves modified, and indirectly modifed topic maps where incldued AsciiDoc files have been updated. +# Handle the git diff differently for Travis and local # Get the *.adoc and distro maps files in the pull request -FILES=$(git diff --name-only HEAD HEAD~$(git rev-list --count --no-merges origin/enterprise-4.14..) --diff-filter=d "*.yml" "*.adoc" ':(exclude)_unused_topics/*') +if [ "$TRAVIS" = true ] ; then + FILES=$(git diff --name-only HEAD $TRAVIS_BRANCH --diff-filter=d "*.yml" "*.adoc" ':(exclude)_unused_topics/*') + +else + FILES=$(git diff --name-only HEAD@{1} --diff-filter=d "*.yml" "*.adoc" ':(exclude)_unused_topics/*') +fi + REPO_PATH=$(git rev-parse --show-toplevel) + # Init an empty array DISTROS=() @@ -39,7 +47,7 @@ for ASSEMBLY in $ALL_ASSEMBLIES; do fi done -# Handle modified topic maps +# Handle modified topic maps UPDATED_DISTROS=$(echo "$FILES" | awk '/_topic_maps\/(.*)\.yml/') # Concat all the updated topic maps DISTROS+=("${UPDATED_DISTROS}")