blob: fd112193eb849f70afc7cab152bf7908c36cf43e [file] [log] [blame]
# Script to rebuild the issuetracker.go file.
if ! command -v google-api-go-generator &> /dev/null
echo "google-api-go-generator could not be found"
echo ""
echo "Run the following command outside of the infra directory:"
echo ""
echo " go install"
if [[ -z "${APIKEY}" ]]; then
echo "The APIKEY env variable must be defined."
echo "The API Key to use is here:"
echo " go/skia-issue-tracker-api-key"
# If this fails make sure you are running as a service account that has access to the API.
# See: # go/skia-issue-tracker-api-creds
go run ./getdiscovery.go --apikey=${APIKEY} > rest.json
# Generate the Go file.
# Note that we specify our own copy of the gensupport library because we are not
# the target audience:
# If this library breaks in the future first try updating our copy of gensupport
# from
google-api-go-generator \
-api_json_file=rest.json \
-api_pkg_base="" \
-gensupport_pkg="" \
# Clean up the generated file.
goimports -w .
# Cleanup.
rm rest.json