From a00cf79882eaf5b68b7963e5d41b152ef76ddf07 Mon Sep 17 00:00:00 2001 From: Miguel Elias dos Santos Date: Tue, 6 Sep 2022 22:29:09 +1000 Subject: [PATCH] Add helper script to run gen script --- hack/gen.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 hack/gen.sh diff --git a/hack/gen.sh b/hack/gen.sh new file mode 100644 index 0000000..28a3c63 --- /dev/null +++ b/hack/gen.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +if [ "$(git branch --show-current)" != "master" ]; then + echo "Not in master branch. Aborting." + exit 1 +fi + +BRANCH_NAME="update-gh-definitions-$(date '+%s')" + +git checkout -b ${BRANCH_NAME} + +go run main.go + +if [ "$(git status --porcelain | wc -l)" != "1" ]; then + echo "Found more changes than expected. Aborting." + exit 1 +fi + +git commit -am "Update GH definitions" + +git push origin ${BRANCH_NAME} \ No newline at end of file