#!/bin/sh -x
rm -rf node_modules
npm install git2consul
rm -f node_modules/git2consul/consul
rm -f node_modules/git2consul/consul_*
version=`grep '"version"' node_modules/git2consul/package.json  | head -1 | sed -e 's;.*: ";;' -e 's;".*;;'`
date=`date '+%Y%m%d'`
tar cvf - node_modules | xz -9 >git2consul-$version-$date.tar.xz
rm -rf node_modules
