pre-push 691 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/bin/env bash
  2. YELLOW="\e[93m"
  3. GREEN="\e[32m"
  4. RED="\e[31m"
  5. ENDCOLOR="\e[0m"
  6. printMessage() {
  7. printf "${YELLOW}AppFlowy : $1${ENDCOLOR}\n"
  8. }
  9. printSuccess() {
  10. printf "${GREEN}AppFlowy : $1${ENDCOLOR}\n"
  11. }
  12. printError() {
  13. printf "${RED}AppFlowy : $1${ENDCOLOR}\n"
  14. }
  15. printMessage "Running local AppFlowy pre-push hook."
  16. if [[ `git status --porcelain` ]]; then
  17. printError "This script needs to run against committed code only. Please commit or stash you changes."
  18. exit 1
  19. fi
  20. #
  21. #printMessage "Running the Flutter analyzer"
  22. #flutter analyze
  23. #
  24. #if [ $? -ne 0 ]; then
  25. # printError "Flutter analyzer error"
  26. # exit 1
  27. #fi
  28. #
  29. #printMessage "Finished running the Flutter analyzer"