#!/bin/bash

rm -rf ngx-sass-module-*.tar.?z*

git clone https://github.com/mneudert/sass-nginx-module.git ngx-sass-module

cd ngx-sass-module
VERSION=$(git log --pretty=format:"git_%cd_%h" --date=format:"%Y%m%d" | head -n 1)
cd ..

mv ngx-sass-module ngx-sass-module-$VERSION

tar --exclude-vcs -cf ngx-sass-module-$VERSION.tar ngx-sass-module-$VERSION
plzip -9 ngx-sass-module-$VERSION.tar

rm -rf ngx-sass-module-$VERSION
