From 681006aeb6adaca5a6ca10ade6444f81c7b917b5 Mon Sep 17 00:00:00 2001 From: Adam Scarr Date: Fri, 31 Aug 2018 10:46:49 +1000 Subject: [PATCH] Add version const --- bin/release | 37 +++++++++++++++++++++++++++++++++++++ cmd/root.go | 3 +++ cmd/version.go | 16 ++++++++++++++++ graphql/version.go | 3 +++ 4 files changed, 59 insertions(+) create mode 100755 bin/release create mode 100644 cmd/version.go create mode 100644 graphql/version.go diff --git a/bin/release b/bin/release new file mode 100755 index 00000000000..43227fafb13 --- /dev/null +++ b/bin/release @@ -0,0 +1,37 @@ +#!/bin/bash + +set -eu + +if ! [ $# -eq 1 ] ; then + echo "usage: ./bin/release [version]" + exit 1 +fi + +VERSION=$1 + +if ! git diff-index --quiet HEAD -- ; then + echo "uncommited changes on HEAD, aborting" + exit 1 +fi + +if [[ ${VERSION:0:1} != "v" ]] ; then + echo "version strings must start with v" + exit 1 +fi + +git fetch origin +git checkout origin/master + +cat > graphql/version.go <