Skip to content

Commit

Permalink
Correct beforeinstall.sh; (hyperledger-archives#1351)
Browse files Browse the repository at this point in the history
* Correct beforeinstall.sh;

* cope with empty commit ranges
  • Loading branch information
mbwhite authored and jt-nti committed Jun 21, 2017
1 parent a7a0f48 commit d6827cb
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .travis/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,16 @@ fi


cd $TRAVIS_BUILD_DIR
touch changefiles.log
git diff --name-only $(echo $TRAVIS_COMMIT_RANGE | sed 's/\.//')

if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
git show --pretty=format: --name-only "$TRAVIS_COMMIT_RANGE"|sort|uniq > changedfiles.log
git show --pretty=format: --name-only "$TRAVIS_COMMIT_RANGE"|sort|uniq >> changedfiles.log || echo Fail
elif [ -n "$TRAVIS_PULL_REQUEST" ]; then
git diff --name-only "$TRAVIS_COMMIT" "$TRAVIS_BRANCH" > changedfiles.log
git diff --name-only "$TRAVIS_COMMIT" "$TRAVIS_BRANCH" >> changedfiles.log || echo Fail
fi

RESULT=$(cat changedfiles | sed '/^\s*$/d' | awk '!/composer-website/ { print "MORE" }')
RESULT=$(cat changedfiles.log | sed '/^\s*$/d' | awk '!/composer-website/ { print "MORE" }')
if [ "${RESULT}" == "" ];
then
echo "Only docs changes"
Expand Down

0 comments on commit d6827cb

Please sign in to comment.