#!/bin/sh -x
rm -rf node_modules
npm install pm2@latest
version=`grep '"version":' node_modules/pm2/package.json | sed -e 's;.*: ";;' -e 's;".*;;' | tail -1`
date=`date '+%Y%m%d'`
tar cvf - node_modules | gzip -9 >pm2-$version-$date.tar.gz
rm -rf node_modules
