summaryrefslogtreecommitdiffstats
path: root/git-hooks/post-merge
blob: 4f4f5a994c6d9c750d4e723c19ffb59e35b3eebf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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