#!/bin/sh
rm -rf vault
mkdir vault
GOPATH=`pwd`/vault
export GOPATH
git clone --depth 1 https://github.com/hashicorp/vault.git $GOPATH/src/github.com/hashicorp/vault
( cd $GOPATH/src/github.com/hashicorp/vault
  go get -v -d
)
#shtool subst \
#  -e 's;linux darwin;freebsd linux darwin;' \
#  $GOPATH/src/github.com/hashicorp/vault/helper/password/password_unix.go
#( cd $GOPATH
#  go get -v -d ./...
#)
tar cvf - --exclude .git vault | xz -9 >vault-`date '+%Y%m%d'`.tar.xz
rm -rf vault
