check_eol.sh 1.3 KB

123456789101112131415161718192021222324252627
  1. #-------------------------------------------------------------------------------------------------------
  2. # Copyright (C) Microsoft. All rights reserved.
  3. # Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. #-------------------------------------------------------------------------------------------------------
  5. # Need to make sure that the reference to origin/master is available.
  6. # We know that HEAD is checked out so that the tests on that source can be run.
  7. # configure the sh environment to run scripts from the bin dir in case that's missing
  8. ls &> /dev/null # checking for ls script on the path
  9. if [ $? -ne 0 ]; then
  10. PATH=/bin:/usr/bin:$PATH
  11. fi
  12. ERRFILE=check_eol.sh.err
  13. rm -f $ERRFILE
  14. git diff --name-only `git merge-base origin/master HEAD` HEAD | grep -v -E "(test/.*\\.js|\\.cmd|\\.baseline|\\.wasm)" | xargs -I % ./jenkins/check_file_eol.sh %
  15. if [ -e $ERRFILE ]; then # if error file exists then there were errors
  16. >&2 echo "--------------" # leading >&2 means echo to stderr
  17. >&2 echo "--- ERRORS ---"
  18. cat $ERRFILE 1>&2 # send output to stderr so it can be redirected as error if desired
  19. exit 1 # tell the caller there was an error (so Jenkins will fail the CI task)
  20. else
  21. echo "--- NO PROBLEMS DETECTED ---"
  22. fi