Guest User

Untitled

a guest
May 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. #!/usr/bin/env bash
  2. # Evaluates a report that running multiple generators results in
  3. # Pet#category being of type Object/Any rather than Category
  4. set -e
  5.  
  6. ROOT=/Users/jim/projects/openapi-generator
  7. targetfile=samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt
  8.  
  9. echo "Building $(git rev-parse --short HEAD)."
  10. mvn -B clean package install 2>&1 >/dev/null
  11.  
  12. if [ $? -ne 0 ]; then
  13. echo "Build faiiled, can't evaluate generator usage"
  14. exit 125
  15. fi
  16.  
  17. env LOG4J_LEVEL=FATAL sh bin/kotlin-client-petstore.sh 2>&1 >/dev/null
  18.  
  19. if [ $? -ne 0 ]; then
  20. echo "Generator failed, can't evaluate if it outputs incorrect code."
  21. exit 125
  22. fi
  23.  
  24. if [ -z "$(cat ${targetfile} | grep 'val category' | grep 'Category')" ]; then
  25. osascript -e "display notification \"$(git rev-parse --short HEAD)\" with title \"Bad commit\""
  26. echo "Missing expected object type"
  27. exit 1
  28. else
  29. osascript -e "display notification \"$(git rev-parse --short HEAD)\" with title \"Good commit\""
  30. echo "Code is fine"
  31. exit 0
  32. fi
Add Comment
Please, Sign In to add comment