#!/bin/bash
tag=v0.6.9
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/kangax/html-minifier.git
cd html-minifier
git archive --format=tar tags/${tag} tests/ Gruntfile.js \
| bzip2 > "$pwd"/nodejs-html-minifier-tests-${tag}.tar.bz2
popd