pre-push 630 B

123456789101112131415161718192021
  1. #!/usr/bin/env bash
  2. if [[ `git status --porcelain` ]]; then
  3. printf "\e[31;1m%s\e[0m\n" 'This script needs to run against committed code only. Please commit or stash you changes.'
  4. exit 1
  5. fi
  6. printf "\e[33;1m%s\e[0m\n" 'Running the Flutter analyzer'
  7. flutter analyze
  8. if [ $? -ne 0 ]; then
  9. printf "\e[31;1m%s\e[0m\n" 'Flutter analyzer error'
  10. exit 1
  11. fi
  12. printf "\e[33;1m%s\e[0m\n" 'Finished running the Flutter analyzer'
  13. printf "\e[33;1m%s\e[0m\n" 'Running unit tests'
  14. #flutter test
  15. #if [ $? -ne 0 ]; then
  16. # printf "\e[31;1m%s\e[0m\n" 'Unit tests error'
  17. # exit 1
  18. #fi
  19. #printf "\e[33;1m%s\e[0m\n" 'Finished running unit tests'