#!/bin/sh -x
rm -rf node_modules
npm install canvas --ignore-scripts
version=`grep '"version":' node_modules/canvas/package.json | sed -e 's;.*: ";;' -e 's;".*;;' | tail -1` 
date=`date '+%Y%m%d'`
tar cvf - --exclude .git node_modules | xz -9 >node-canvas-$version-$date.tar.xz
rm -rf node_modules
