#!/bin/bash
tag=v1.1.1
set -e
tmp=$(mktemp -d)
trap cleanup EXIT
cleanup() {
set +e
[ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp"
}
unset CDPATH
pwd=$(pwd)
pushd "$tmp"
git clone https://github.com/mafintosh/tar-stream.git
cd tar-stream
git archive --format=tar tags/${tag} test/ \
| bzip2 > "$pwd"/nodejs-tar-stream-tests-${tag}.tar.bz2
popd