From 9de52c2a252b8de46b10a57c8ff2e69c75cabdd3 Mon Sep 17 00:00:00 2001 From: Joakim Reinert Date: Mon, 4 May 2015 00:28:51 +0200 Subject: Add update script to git-hooks to be run after git pull --- git-hooks/post-merge | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 git-hooks/post-merge (limited to 'git-hooks/post-merge') diff --git a/git-hooks/post-merge b/git-hooks/post-merge new file mode 100755 index 000000000..4f4f5a994 --- /dev/null +++ b/git-hooks/post-merge @@ -0,0 +1,20 @@ +#!/usr/bin/bash + +if [[ -z "$GIT_DIR" ]]; then + GIT_DIR="$(dirname "$(realpath "$0")")/../.git" +fi + +cd "$GIT_DIR/.." + +changes=$(git diff --name-only @{1}) + +# Exit if nothing has changed +[[ -z "$changes" ]] && exit + +# Update databse +php index.php tools update_database + +# Minify javascript +if echo "$changes" | grep data/js/ > /dev/null; then + scripts/optimize_js.sh +fi -- cgit v1.2.3-24-g4f1b