check_eol.sh 1.4 KB

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