pre-push 679 B

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