#!/bin/bash

# In order to make this work
#
# 0. assume to have git already installed
#
# 1. install needed system packages by running as root:
# apt-get install ruby
# gem install sass
#
# and
#
# 2. the following must be executed from the repository root:
# cd .git/hooks/
# ln -s ../../inst/rmarkdown/templates/ImmuneSpace/resources/git-pre-commit-hook pre-commit
# chmod +x pre-commit

### Are any Sass files canged and added?
if git status -s | grep  '^M.\+s[ac]ss$'
then
	sass --update inst/rmarkdown/templates/ImmuneSpace/resources/IStemplate.scss:inst/rmarkdown/templates/ImmuneSpace/resources/IStemplate.css
	git add inst/rmarkdown/templates/ImmuneSpace/resources/IStemplate.css -f
fi

exit 0

