From d103ed6ca97ca5a2669f6cf5fe4b3d2a9c945f26 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 17 May 2017 16:51:25 -0400 Subject: Upgrading server dependancies (#6431) --- .../hashicorp/go-multierror/scripts/deps.sh | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100755 vendor/github.com/hashicorp/go-multierror/scripts/deps.sh (limited to 'vendor/github.com/hashicorp/go-multierror/scripts') diff --git a/vendor/github.com/hashicorp/go-multierror/scripts/deps.sh b/vendor/github.com/hashicorp/go-multierror/scripts/deps.sh new file mode 100755 index 000000000..1d2fcf98c --- /dev/null +++ b/vendor/github.com/hashicorp/go-multierror/scripts/deps.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash +# +# This script updates dependencies using a temporary directory. This is required +# to avoid any auxillary dependencies that sneak into GOPATH. +set -e + +# Get the parent directory of where this script is. +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done +DIR="$(cd -P "$(dirname "$SOURCE")/.." && pwd)" + +# Change into that directory +cd "$DIR" + +# Get the name from the directory +NAME=${NAME:-"$(basename $(pwd))"} + +# Announce +echo "==> Updating dependencies..." + +echo "--> Making tmpdir..." +tmpdir=$(mktemp -d) +function cleanup { + rm -rf "${tmpdir}" +} +trap cleanup EXIT + +export GOPATH="${tmpdir}" +export PATH="${tmpdir}/bin:$PATH" + +mkdir -p "${tmpdir}/src/github.com/hashicorp" +pushd "${tmpdir}/src/github.com/hashicorp" &>/dev/null + +echo "--> Copying ${NAME}..." +cp -R "$DIR" "${tmpdir}/src/github.com/hashicorp/${NAME}" +pushd "${tmpdir}/src/github.com/hashicorp/${NAME}" &>/dev/null +rm -rf vendor/ + +echo "--> Installing dependency manager..." +go get -u github.com/kardianos/govendor +govendor init + +echo "--> Installing all dependencies (may take some time)..." +govendor fetch -v +outside + +echo "--> Vendoring..." +govendor add +external + +echo "--> Moving into place..." +vpath="${tmpdir}/src/github.com/hashicorp/${NAME}/vendor" +popd &>/dev/null +popd &>/dev/null +rm -rf vendor/ +cp -R "${vpath}" . -- cgit v1.2.3-1-g7c22