From b82ab2cc6a52088c66883be72f75efcc2ce296d1 Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Mon, 1 Jul 2019 11:03:07 -0700 Subject: [PATCH] change installation of pigeon if off gopath --- Makefile | 7 ++++++- scripts/off_gopath.sh | 22 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100755 scripts/off_gopath.sh diff --git a/Makefile b/Makefile index f33955362..d68836874 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,12 @@ install-build-deps: ## Install dependencies for bin build install-gen-deps: ## Install dependencies for code generation @go get golang.org/x/tools/cmd/goimports - @go get -u github.com/mna/pigeon + @./scripts/off_gopath.sh; if [ $$? -eq 0 ]; then \ + go get github.com/mna/pigeon@master; \ + else \ + go get -u github.com/mna/pigeon; \ + fi + @go get github.com/alvaroloes/enumer dev: ## Build and install a development build diff --git a/scripts/off_gopath.sh b/scripts/off_gopath.sh new file mode 100755 index 000000000..ead92a6d7 --- /dev/null +++ b/scripts/off_gopath.sh @@ -0,0 +1,22 @@ +#! /usr/bin/env bash + +set -eu -o pipefail + +gpath=${GOPATH:-} +if [ -z "$gpath" ]; then + gpath=$HOME/go +fi + +reldir=`dirname $0` +curdir=`pwd` +cd $reldir +CUR_GO_DIR=`pwd` +cd $curdir + +if [[ $CUR_GO_DIR == *"$gpath"* ]]; then + # echo "You're on the gopath" + exit 1 +else + # echo "You're not on the gopath" + exit 0 +fi \ No newline at end of file