#!/bin/sh -x
rm -rf elvish
GOPATH="`pwd`/elvish"
export GOPATH
mkdir -p $GOPATH
git clone --depth 1 https://github.com/elves/elvish $GOPATH/src/github.com/elves/elvish
( cd $GOPATH/src/github.com/elves/elvish
  go get -v -d
)
tar cvf - --exclude .git elvish | xz -9 >elvish-`date '+%Y%m%d'`.tar.xz
rm -rf elvish
