Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- # Evaluates a report that running multiple generators results in
- # Pet#category being of type Object/Any rather than Category
- set -e
- ROOT=/Users/jim/projects/openapi-generator
- targetfile=samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/models/Pet.kt
- echo "Building $(git rev-parse --short HEAD)."
- mvn -B clean package install 2>&1 >/dev/null
- if [ $? -ne 0 ]; then
- echo "Build faiiled, can't evaluate generator usage"
- exit 125
- fi
- env LOG4J_LEVEL=FATAL sh bin/kotlin-client-petstore.sh 2>&1 >/dev/null
- if [ $? -ne 0 ]; then
- echo "Generator failed, can't evaluate if it outputs incorrect code."
- exit 125
- fi
- if [ -z "$(cat ${targetfile} | grep 'val category' | grep 'Category')" ]; then
- osascript -e "display notification \"$(git rev-parse --short HEAD)\" with title \"Bad commit\""
- echo "Missing expected object type"
- exit 1
- else
- osascript -e "display notification \"$(git rev-parse --short HEAD)\" with title \"Good commit\""
- echo "Code is fine"
- exit 0
- fi
Add Comment
Please, Sign In to add comment