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