Merge pull request #10898 from tbg/dep
scripts: fail explicitly in updatedep.sh when gopath.proto existsrelease-3.4
commit
f498392ca7
|
@ -38,7 +38,14 @@ SCHWAG_ROOT="${GOPATH}/src/github.com/hexfusion/schwag"
|
||||||
GOGOPROTO_PATH="${GOGOPROTO_ROOT}:${GOGOPROTO_ROOT}/protobuf"
|
GOGOPROTO_PATH="${GOGOPROTO_ROOT}:${GOGOPROTO_ROOT}/protobuf"
|
||||||
GRPC_GATEWAY_ROOT="${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway"
|
GRPC_GATEWAY_ROOT="${GOPATH}/src/github.com/grpc-ecosystem/grpc-gateway"
|
||||||
|
|
||||||
rm -f "${ETCD_ROOT}"
|
function cleanup {
|
||||||
|
# Remove the whole fake GOPATH which can really confuse go mod.
|
||||||
|
rm -rf "${PWD}/gopath.proto"
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanup
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
mkdir -p "${ETCD_IO_ROOT}"
|
mkdir -p "${ETCD_IO_ROOT}"
|
||||||
ln -s "${PWD}" "${ETCD_ROOT}"
|
ln -s "${PWD}" "${ETCD_ROOT}"
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,13 @@ if ! [[ "$0" =~ scripts/updatedep.sh ]]; then
|
||||||
exit 255
|
exit 255
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d "gopath.proto" ]; then
|
||||||
|
# gopath.proto is created by genproto.sh and it thoroughly messes
|
||||||
|
# with go mod.
|
||||||
|
echo "Remove gopath.proto before running this script"
|
||||||
|
exit 255
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ $(go version) != "go version go1.12"* ]]; then
|
if [[ $(go version) != "go version go1.12"* ]]; then
|
||||||
echo "expect Go 1.12+, got:" "$(go version)"
|
echo "expect Go 1.12+, got:" "$(go version)"
|
||||||
exit 255
|
exit 255
|
||||||
|
|
Loading…
Reference in New Issue